Home > Article > Operation and Maintenance > Use vim to build python environment configuration under Ubuntu
1. Install complete vim
# apt-get install vim-gnome
2. Install ctags, ctags is used to support taglist, required!
# apt-get install ctags
3. Install taglist
#apt-get install vim-scripts
#apt-get install vim-addon-manager
# vim-addons install taglist
4. Install pydiction (implement code completion)
#wget
#unzip pydiction-1.2.zip
// ~/.vim/after/ftplugin and The ~/.vim/tools/pydiction/ directory does not exist by default and needs to be created by yourself
#cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin
#cp pydiction-1.2/complete-dict ~ /.vim/tools/pydiction/complete-dict
5. Edit the configuration file
//~/.vimrc to modify the current user configuration. If you need to modify the global configuration, vim /etc/vim/vimrc
# vim ~/.vimrc
let 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 on autocmd 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 autoindent set tabstop=4set shiftwidth=4set expandtab set number set lines=35 columns=118
On the right is the taglist window, press F8 to open it, use Ctrl+w, and then press w to switch between the code window and the taglist window
The above is the detailed content of Use vim to build python environment configuration under Ubuntu. For more information, please follow other related articles on the PHP Chinese website!