1. 程式人生 > >sublime text3 python程式碼自動提示/補全外掛sublimecodeintel配置

sublime text3 python程式碼自動提示/補全外掛sublimecodeintel配置

自動提示/補全python程式碼

選擇 Perference-Package Settings-SublimeCodeIntel-Settings-User,複製以下配置:

{
    "codeintel_language_settings": {
        "Python3": {
            "python3": "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\python.exe",
            "codeintel_scan_extra_dir": [
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\DLLs",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\Lib",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\idlelib",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\python36.zip",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36",
                "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\*",
            ],
            "codeintel_scan_files_in_project": true,
            "codeintel_selected_catalogs": []
        },
    }
}

這裡python路徑需要根據自己的安裝路徑定義,其中codeintel_scan_extra_dir包含的目錄可以在python IDLE中sys.path檢視. 

追蹤函式、檢視系統函式

配置快捷鍵使其同eclipse,實現ctrl+滑鼠左鍵追蹤函式,alt+left/right跳轉,alt+/自動提示程式碼

選擇 Perference-package Settings-SublimeCodeIntel-Key Bindings-User

[
{ "keys": ["f5"], "caption": "SublimeREPL:Python", 
                      "command": "run_existing_window_command", "args":
                      {
                           "id": "repl_python_run",
                           "file": "config/Python/Main.sublime-menu"
                      } 
    },
   //自動提示程式碼
{ "keys": ["alt+/"], "command": "code_intel_auto_complete" },
//跳轉到函式定義
{ "keys": ["alt+right"], "command": "goto_python_definition"},
//返回到跳轉位置
{ "keys": ["alt+left"], "command": "back_to_python_definition"}
]

選擇 Perference-package Settings-SublimeCodeIntel-Mouse Bindings - User


[
        //ctrl+滑鼠左鍵跳轉函式
        { "button": "button1", "modifiers": ["ctrl"], "command": "goto_python_definition", "press_command": "drag_select" }
]

效果圖

美中不足的是程式碼提示有點小卡頓.如果有什麼優化方法,望分享!

這裡寫圖片描述