VIM python 自動補全插件:pydiction這是一個相當不錯的 Python 代碼自動完成的腳本。 可以實現(xiàn)下面python代碼的自動補全: 1.
簡單python關鍵詞補全 2.
python 函數(shù)補全帶括號 3.
python 模塊補全 4.
python 模塊內函數(shù),變量補全 5.
from module import sub-module
補全 pydiction 插件安裝
pydiction 1.0 之后版本安裝配置
適用VIM7之后的版本。 1.python_pydiction.vim
將文件 python_pydiction.vim 放到 ~/.vim/after/ftplugin/ 路徑下,如果這個路徑不存在,你可以自己創(chuàng)建這個文件夾結構。(Windows下面的話放在目錄類似的結構中) 2.complete-dict
將complete-dict文件放到你自己的某個路徑下,后面的配置會用到這個文件,這個文件就是記錄所有的python關鍵詞。 我將這個文件放到 ~/.vim/tools/pydiction/ 3. 配置 .vimrc 文件
在 ~/.vimrc 文件中添加如下配置 "pydiction 1.2 python auto completefiletype plugin onlet g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'"defalut g:pydiction_menu_height == 15"let g:pydiction_menu_height = 20
pydiction 1.0 之前版本安裝配置
為了使用這個功能,我把pydiction 放在了 ~/.vim/tools 目錄中,并在 .vimrc 中增加如下設置: " python auto-complete code" Typing the following (in insert mode):" os.lis<Ctrl-n>" will expand to:" os.listdir(" Python 自動補全功能,只需要反覆按 Ctrl-N 就行了 if has("autocmd") autocmd FileType python set complete+=k~/.vim/tools/pydictionendif
pydiction 自動補全插件使用
pydiction 1.2 版本在VIM中直接用 <Tab> 鍵就可以實現(xiàn)自動補全。 在vim中鍵入 os.pa<Tab> 后出現(xiàn)的自動補全界面 ![]() pydiction 插件下載
§ 本地下載:pydiction
1.2 (2009年7月25日更新) § 官方地址: http://vim./scripts/script.php?script_id=850 |
|
|