VIM 配置Python开发环境 Taglist + Pydiction+Hightlight+Python_fold + NERD_TREE+.....
Luo weifeng 2011-7-16
1. 安装完整的VIM
#apt-get install vim-gnome
2. 安装Ctags
#apt-get install ctags
3. 安装TagList
#apt-get install vim-scripts
#apt-get install vim-addon-manager
# vim-addons install taglist
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 tabstop=4 set shiftwidth=4 set expandtab set number
附加:highlight
http://www.vim.org/scripts/script.php?script_id=1599Line mode
<C-h><C-h> Highlight current line
<C-h><C-a> Advance color for next line highlight
<C-h><C-r> Clear last line highlight
Pattern mode
<C-h><C-w> Highlight word under cursor (whole word match)
<C-h><C-l> Highlight all lines having word under cursor (whole word match)
<C-h><C-f> Highlight word under cursor (partial word match)
<C-h><C-k> Highlight all lines having word under cursor (partial word match)
<C-h><C-s> Highlight last search pattern
<C-h><C-j> Highlight all lines having last search pattern
<C-h><C-d> Clear last pattern highlight
<C-h><C-n> Clear all highlights
All above commands work in both normal & insert modes.
<C-h><C-h> also works in visual mode. (Select desired lines & hit <C-h><C-h>)
http://vim.sourceforge.net/scripts/script.php?script_id=515
zo 展开
zc 收起
zn 全部展开
zN 全部折叠
NERD_TREE 目录树(强烈推荐)
安装方法如下:
1.下载插件文件
http://www.vim.org/scripts/script.php?script_id=1658
解压文件到~/.vim/目录下,如果没有此目录,则要自己创建。
2.添加配置文件
在~/.vimrc 或 /etc/vim/vimrc文件里添加如下配置
“”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"
” F7 NERDTree
“”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"”"
map <F7> :NERDTreeToggle<CR>
imap <F7> <ESC>:NERDTreeToggle<CR>
则在VIM里按下F7就可打开关闭目录树。具体操作命令请查看插件doc目录下的帮助文件。
Auto Complete 这个比较霸气
http://www.vim.org/scripts/script.php?script_id=1879
minibuffer
http://www.vim.org/scripts/script.php?script_id=159