pydiction简介

pydiction是一段python代码自动补全的脚本,它可以实现如下功能:

1、python关键字补全

2、函数补全

3、模块补全

4、模块内部函数、变量补全

5、被引入模块的子模块补全

下载地址:http://vim.sourceforge.net/scripts/script.php?script_id=850


Vim配置

版本要求:

vim - 7.0以上

pydiction - 1.2以上

[root@vim ~]# mkdir -p ~/.vim/bundle
[root@vim ~]# mkdir -p ~/.vim/tools/pydiction/
[root@vim ~]# mkdir -p ~/.vim/after/ftplugin
[root@vim ~]# cd ~/.vim/bundle/
[root@vim ~]# git clone https://github.com/rkulla/pydiction.git
[root@vim ~]# cp pydiction/after/ftplugin/python_pydiction.vim ~/.vim/after/ftplugin/
[root@vim ~]# cp pydiction/complete-dict ~/.vim/tools/pydiction/
[root@vim ~]# cat ~/.vimrc   # vim配置文件
"自动保存
set autowrite
"打开状态栏标尺
set ruler      
"突出显示当前行
set cursorline     
"语法高亮
set syntax=on  
"取消输入错误提示音
set noeb            
"自动缩进
set autoindent
set cindent
"设置tab宽度为4个空格
set tabstop=4
set expandtab
"统一缩进为4
set softtabstop=4
set shiftwidth=4
"匹配括号高亮显示
set showmatch
"匹配括号高亮时间(1/10秒)
set matchtime=1
"pydiction配置
filetype plugin on
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
let g:pydiction_menu_height = 20


在vim中使用tab键就可以自动补全。

wKioL1XQZv6QoSDPAAMgVfNDHnc477.jpg


参考链接

http://www.pythonclub.org/linux/vim/pydiction