用 vundle 來管理 vim 插件
- 首先vundle 來管理vim 是潮流嫂冻,并且方便快捷
- 它使用類似 Ruby Bundler 的方式來管理插件,你只需要在.vimrc里面用Bundle聲明插件
具體參考下面的介紹
vundle.txt
下面介紹下我的安裝過程
- 下載MacVim
- 在~/目錄下面創(chuàng)建 .vim 目錄塞椎,然后再創(chuàng)建 .vim/bundle
- cd ~/.vim/bundle 目錄桨仿,然后執(zhí)行 git clone https://github.com/gmarik/vundle.git 等待完成
- 在 ~/.vimrc這個文件的頭部加上下面這個配置,這個是官網(wǎng)的介紹
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install plugins
"let path = '~/some/path/here'
"call vundle#rc(path)
" let Vundle manage Vundle, required
Plugin 'gmarik/vundle'
" The following are examples of different formats supported.
" Keep Plugin commands between here and filetype plugin indent on.
" scripts on GitHub repos
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'tpope/vim-rails.git'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" scripts from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
Plugin 'FuzzyFinder'
" scripts not on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" ...
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - list configured plugins
" :PluginInstall(!) - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin commands are not allowed.
" Put your stuff after this line
隨便開個窗口案狠,從控制臺打開vim , 執(zhí)行
:PluginInstall
服傍,即可安裝 Plugin 指定的插件-
我在.vimrc 文件中钱雷,在最后一行加載 填寫
Bundle 'rking/ag.vim'
在執(zhí)行
:PluginInstall
就會安裝我的ag.vim最后在我的MacVim就可以使用
:Ag bababab
就可以使用了。
順便說下吹零,比 ack 更快更好用的東東:the silver searcher罩抗, 速度能提升5倍。
宣傳語
歷經(jīng)兩個半月的準備灿椅,三次大改版套蒂,十七次小改版。le1024終于要和大家見面了茫蛹。
le1024每天推薦1~3段操刀,有趣、有愛麻惶、有故事的視頻。
為您工作信夫、學習窃蹋、生活之余增加一點快樂的感覺。