Vim插件管理 -- Vundle


 

1 插件目錄  ~/.vim/bundle/ 沒有可自行建立python

 

2 安裝Vundlegit

   $ git clone https://github.com/VundleVim/Vundle.vim.git   ~/.vim/bundle/Vundle.vim github

3 配置插件vim

   vi ~/.vimrc app

  添加:  ui

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" plugin on GitHub repo
Plugin 'rkulla/pydiction'     "Python Tab自動補全
Plugin 'scrooloose/nerdtree' "能夠顯示資源列表
Plugin 'tomasr/molokai' "molokai主題
" All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " Brief help " :PluginList - lists configured plugins " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal

4 安裝插件spa

  保存上面配置文件,進入vim(或vi打開任意文件),執行:插件

   :PluginInstall ,會自動從github獲取安裝配置文件中添加的插件。code

   :PluginList 能夠查看已經安裝的插件blog

5 卸載插件

  將.vimrc中安裝插件行註釋或刪除,執行 :PluginClean 

 


 

經常使用插件

NERD Tree

  功能:

  安裝:在.vimrc中添加  Plugin 'scrooloose/nerdtree' , 執行 :PluginInstall 

  配置:爲了方便,能夠在.vimrc中配置開關快捷鍵 

        map <F3> :NERDTreeToggle<CR> 

     配置當只剩NERDTree時,自動關閉vim:

             autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif 

  用法:

    F3(上面配置的)  --  打開/關閉 NERDTree

    s  --  水平分割式打開文件(光標所在行的文件)

    i  --   豎直方向...

  

  

 

2 pydiction

  功能:python的Tab鍵自動補全

  安裝:同上

  配置:在.vimrc中添加如下    

filetype plugin on   

let g:pydiction_location = '/home/user/.vim/bundle/pydiction/complete-dict'   

let g:pydiction_menu_height = 4   "顯示匹配結果的行數,默認爲8

  用法:

<Space>              -- 接受當前匹配,並添加一個空格
CTRL-Y               -- 接受當前匹配,但不添加空格
<Enter>              -- 接受當前匹配,並轉到下一行
CTRL-E            -- 取消當前匹配

  

 

3 molokai

一個比較舒服的主題
molokai.vim拷貝到~/.vim/colors/ 或者/usr/share/vim/vim74/colors/目錄中
在.vimrc中配置  
syntax enable

set to_Co=256

set background=dark

colorscheme molokai

相關文章
相關標籤/搜索