vim python自动补全功能
2016-10-18 21:41
393 查看
1. 安装完整的vim
# apt-get install vim-gnome
2. 安装ctags,ctags用于支持taglist,必需!
# apt-get install ctags
3. 安装taglist
#apt-get install vim-scripts
#apt-get install vim-addon-manager
// 貌似我在安装vim-scripts的时候,已经附带安装了vim-addon-manager
# vim-addons install taglist
4. 安装pydiction(实现代码补全)
#wget http://www.pythonclub.org/_media/python-basic/pydiction-1.2.zip
#unzip pydiction-1.2.zip
// ~/.vim/after/ftplugin和~/.vim/tools/pydiction/目录默认不存在,需要自行创建
#cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin
#cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict
5. 编辑配置文件
# vim ~/.vimrc
以下是配置文件的内容:
[html] view
plain copy
let Tlist_Auto_Highlight_Tag=1
let Tlist_Auto_Open=1
let Tlist_Auto_Update=1
let Tlist_Display_Tag_Scope=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Enable_Dold_Column=1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Show_One_File=1
let Tlist_Use_Right_Window=1
let Tlist_Use_SingleClick=1
nnoremap <silent> <F8> :TlistToggle<CR>
filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
let g:pydiction_location='~/.vim/tools/pydiction/complete-dict'
set autoindent
set tabstop=4
set shiftwidth=4
set expandtab
set number
其中,
filetype plugin on:表示开启插件。
let g:pydiction_location='~/.vim/tools/pydiction/complete-dict' : 写入你存放complete-dict的绝对路径。
参考:
http://www.350351.com/bianchengyuyan/Python/344419.html http://www.cnblogs.com/Bonker/p/4058728.html https://www.zhihu.com/question/20381207 http://blog.csdn.net/u010388829/article/details/41846235
# apt-get install vim-gnome
2. 安装ctags,ctags用于支持taglist,必需!
# apt-get install ctags
3. 安装taglist
#apt-get install vim-scripts
#apt-get install vim-addon-manager
// 貌似我在安装vim-scripts的时候,已经附带安装了vim-addon-manager
# vim-addons install taglist
4. 安装pydiction(实现代码补全)
#wget http://www.pythonclub.org/_media/python-basic/pydiction-1.2.zip
#unzip pydiction-1.2.zip
// ~/.vim/after/ftplugin和~/.vim/tools/pydiction/目录默认不存在,需要自行创建
#cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin
#cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict
5. 编辑配置文件
# vim ~/.vimrc
以下是配置文件的内容:
[html] view
plain copy
let Tlist_Auto_Highlight_Tag=1
let Tlist_Auto_Open=1
let Tlist_Auto_Update=1
let Tlist_Display_Tag_Scope=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Enable_Dold_Column=1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Show_One_File=1
let Tlist_Use_Right_Window=1
let Tlist_Use_SingleClick=1
nnoremap <silent> <F8> :TlistToggle<CR>
filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
let g:pydiction_location='~/.vim/tools/pydiction/complete-dict'
set autoindent
set tabstop=4
set shiftwidth=4
set expandtab
set number
其中,
filetype plugin on:表示开启插件。
let g:pydiction_location='~/.vim/tools/pydiction/complete-dict' : 写入你存放complete-dict的绝对路径。
参考:
http://www.350351.com/bianchengyuyan/Python/344419.html http://www.cnblogs.com/Bonker/p/4058728.html https://www.zhihu.com/question/20381207 http://blog.csdn.net/u010388829/article/details/41846235
相关文章推荐
- vim 安装自动补全python代码功能
- [转载]启用 VIM 中的 Python 自动补全及提示功能
- 如何启用vim自带python自动补全功能
- 启用 VIM 中的 Python 自动补全及提示功能
- 如何在配置vim的(Python)代码自动补全功能
- vim下c++自动补全和类似source insight功能配置
- 让vim支持c++代码自动补全功能。
- 为python命令行添加Tab键自动补全功能
- vim python自动补全
- Linux下vim中加入vjde,实现自动补全功能:
- vim代码自动补全功能
- 【ubuntu】vim安装python自动补全插件(1)
- 在cmd下打开python shell的tab自动补全功能
- 在Vim中使用python让Opencv函数自动补全
- vim自带的自动补全功能
- 【ubuntu】vim安装python自动补全插件(2)
- VIM python 自动补全插件:pydiction
- vim自动补全功能
- VIM python 自动补全插件pydiction
- vim python自动补全方法 分类: ubuntu python基础学习 虚拟机 测试 2013-07-05 15:37 603人阅读 评论(0) 收藏