Under Ubuntu vim builds python environment configuration

  • 2020-06-03 07:17:25
  • OfStack

1. Install the complete vim


# apt-get install vim-gnome

2. Install ctags, ctags 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 (code completion)


#wget http://www.pythonclub.org/_media/Python-basic/pydiction-1.2.zip
#unzip pydiction-1.2.zip
// ~/.vim/after/ftplugin and ~/.vim/tools/pydiction/ Directories do not exist by default and need 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 configuration files


//~/.vimrc  Modify the current user configuration. If you need to modify the global configuration, vim /etc/vim/vimrc
# 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 and 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
set lines=35 columns=118

On the right is the taglist window. Press F8 to open it. Use Ctrl+w.


Related articles: