Ubuntu安装Vim的Python自动补全插件

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

以下是配置文件的内容:

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



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值