sublimetext3python代码⾃动提⽰补全插件sublimecodeintel配
置
SublimeCodeIntel代码⾃动补全配置
作者主要使⽤python3,所有配置以python3为例.其他语⾔同理.利⽤sublimeCodeIntel插件可以实现⾃动提⽰python3代码、跳转追踪⾃定义函数、查看系统函数等.功能还是相当强⼤的。
⾃动提⽰/补全python代码
选择 Perference-Package Settings-SublimeCodeIntel-Settings-User,复制以下配置:
{
"codeintel_language_settings": {
"Python3": {
"python3": "C:\\Users\\xmm\\AppData\\Local\\Programs\\Python\\Python36\\",
"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",
sublime text3安装教程"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" } ]
效果图
美中不⾜的是代码提⽰有点⼩卡顿.如果有什么优化⽅法,望分享!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论