设为首页 加入收藏

TOP

Python 之Vim编写Python自动补全
2014-11-24 00:08:14 来源: 作者: 【 】 浏览:5
Tags:Python Vim 编写 自动

插件的安装如下:


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 on


let g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict'


3.编写一python文件测试


import datetime
datetime
datetime /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
~
~


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Python 之连接MySQL模块-MySQLdb 下一篇Python 之itertools模块

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: