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-addons install taglist
4. 安裝pydiction(實(shí)現(xiàn)代碼補(bǔ)全)
#wget http://www.pythonclub.org/_media/Python-basic/pydiction-1.2.zip#unzip pydiction-1.2.zip// ~/.vim/after/ftplugin和~/.vim/tools/pydiction/目錄默認(rèn)不存在,需要自行創(chuàng)建#cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin#cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict
5. 編輯配置文件
//~/.vimrc 修改當(dāng)前用戶配置,如果需要修改全局配置,vim /etc/vim/vimrc# vim ~/.vimrclet Tlist_Auto_Highlight_Tag=1let Tlist_Auto_Open=1let Tlist_Auto_Update=1let Tlist_Display_Tag_Scope=1let Tlist_Exit_OnlyWindow=1let Tlist_Enable_Dold_Column=1let Tlist_File_Fold_Auto_Close=1let Tlist_Show_One_File=1let Tlist_Use_Right_Window=1let Tlist_Use_SingleClick=1nnoremap <silent> <F8> :TlistToggle<CR>filetype plugin onautocmd FileType python set omnifunc=pythoncomplete#Completeautocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJSautocmd FileType html set omnifunc=htmlcomplete#CompleteTagsautocmd FileType css set omnifunc=csscomplete#CompleteCSSautocmd FileType xml set omnifunc=xmlcomplete#CompleteTagsautocmd FileType php set omnifunc=phpcomplete#CompletePHPautocmd FileType c set omnifunc=ccomplete#Completelet g:pydiction_location='~/.vim/tools/pydiction/complete-dict'set autoindentset tabstop=4set shiftwidth=4set expandtabset numberset lines=35 columns=118
右邊即為taglist窗口,按F8打開,使用Ctrl+w,再按w可以在code窗口和taglist窗口間切換。
以上所述是小編給大家介紹的 Ubuntu 下 vim 搭建python 環(huán)境 配置,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)VEVB武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選