1.下载自动补全插件
git clone
https://github.com/rkulla/pydiction.git
2.解压包
***将包内的python_pydiction.vim 文件放到/root/.vim/after/ftplugin/ 目录下,
***把complete-dict文件放到任意一个路径下,但需要在.vimrc文件中指定该路径。比如:/root/.vim/bundle/pydiction/complete-dict
3.修改.vimrc文件
在文件中加入如下内容:
set hlsearch
set backspace=2
set ruler
set showmode
syntax on
set filetype=python
au BufNewFile,BufRead *.py,*.pyw setf python
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set nu
filetype plugin on
let g:pydiction_location='/root/.vim/bundle/pydiction/complete-dict'
let g:pydiction_menu_height=3
set autoindent " same level indent
set smartindent " next level indent
PS:配置完成后,实现语法高亮,自动补全命令,下一行自动缩进等功能。