:vim - python自动补全插件
插件的安装如下:
1.下载插件包
https://github.com/vim-scripts/Pydiction可以直接下载,也可git下载[root@localhost ~]# mkdir zhu[root@localhost ~]# cd zhu[root@localhost zhu]# git clone https://github.com/rkulla/pydiction.git#####################包括三个文件python_pydiction.vim #vim插件complete-dict #python关键字和模块列表,pydiction.py #python脚本,可以添加更多的模块
2.配置
#1.查看家目录下是否有.vim目录,若没有则创建。mkdir -p ~/.vim/after/ftplugin/pydiction#2.把上面下载的三个文件放到指定的位置mv python_pydiction.vim ~/.vim/after/ftplugin/mv complete-dict pydiction.py ~/.vim/after/ftplugin/pydiction/#3.修改 ~/.vimrc文件,若没有则创建,在该文件中添加下面两行。filetype plugin onlet g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict'
3.编写一python文件测试
import datetime
datetimedatetime /root/.vim/after/ftplugin/pydiction/complete-dict datetime.MAXYEAR /root/.vim/after/ftplugin/pydiction/complete-dict datetime.MINYEAR /root/.vim/after/ftplugin/pydiction/complete-dict datetime.__doc__ /root/.vim/after/ftplugin/pydiction/complete-dict datetime.__file__ /root/.vim/after/ftplugin/pydiction/complete-dict datetime.__name__ /root/.vim/after/ftplugin/pydiction/complete-dict datetime.__package__ /root/.vim/after/ftplugin/pydiction/complete-dict datetime.date( /root/.vim/after/ftplugin/pydiction/complete-dict datetime.datetime( /root/.vim/after/ftplugin/pydiction/complete-dict datetime.datetime_CAPI /root/.vim/after/ftplugin/pydiction/complete-dict datetime.time( /root/.vim/after/ftplugin/pydiction/complete-dict datetime.timedelta( /root/.vim/after/ftplugin/pydiction/complete-dict datetime.tzinfo( /root/.vim/after/ftplugin/pydiction/complete-dict date( /root/.vim/after/ftplugin/pydiction/complete-dict datetime( /root/.vim/after/ftplugin/pydiction/complete-dict ~ ~