VundleからNeoBundleへの移行

neocomplecacheやunite.vimで有名なShougoさんのプラグイン管理プラグイン。
http://vim-users.jp/2011/10/hack238/
https://github.com/Shougo/neobundle.vim

Vundleから移行しました。

準備

自分はドットファイルをdotfilesというディレクトリ(githubで共有)で管理している。
https://github.com/sugilog/dotfiles
んで、dotfilesの下に、.vim/vundle.gitで今までvundleをsubmoduleとして取り込んでいた。

ということで準備として、~/dotfiles/.vim/vundle.git を削除
ついでに、Vundleで取り込んでいたプラグインがある~/.vimも削除してしまう

neobundleの導入

git submodule add https://github.com/Shougo/neobundle.vim.git

で、~/dotfiles/neobundle.vimにsubmoduleとして追加された。

vimrcの修正

http://vim-users.jp/2011/10/hack238/ を元に、以下のように書き換えてみた。

diff --git a/.vimrc b/.vimrc
index d60fdee..0f431cf 100644
--- a/.vimrc
+++ b/.vimrc
 """"""""""""""""""""""""""""""""""""""""""""""""""
 set nocompatible
 filetype off
-set rtp+=~/dotfiles/.vim/vundle.git/
-call vundle#rc()
-
-Bundle 'Shougo/neocomplcache'
-Bundle 'hrp/EnhancedCommentify'
-Bundle 'vim-scripts/yanktmp.vim'
-Bundle 'tsaleh/vim-matchit'
-Bundle 'tpope/vim-rails'
-Bundle 'vim-scripts/svn-diff.vim'
-Bundle 'tsaleh/vim-align'
-Bundle 'janx/vim-rubytest'
-Bundle 'Shougo/unite.vim'
-Bundle 'othree/eregex.vim'
-Bundle 'thinca/vim-ref'
-Bundle 'tpope/vim-haml'
-Bundle 'vim-ruby/vim-ruby'
+set rtp+=~/dotfiles/neobundle.vim
+
+if has('vim_starting')
+  set runtimepath+=~/dotfiles/neobundle.vim
+  call neobundle#rc(expand('~/.vim/'))
+endif
+
+NeoBundle 'Shougo/neocomplcache'
+NeoBundle 'hrp/EnhancedCommentify'
+NeoBundle 'vim-scripts/yanktmp.vim'
+NeoBundle 'tsaleh/vim-matchit'
+NeoBundle 'tpope/vim-rails'
+NeoBundle 'vim-scripts/svn-diff.vim'
+NeoBundle 'tsaleh/vim-align'
+NeoBundle 'janx/vim-rubytest'
+NeoBundle 'Shougo/unite.vim'
+NeoBundle 'othree/eregex.vim'
+NeoBundle 'thinca/vim-ref'
+NeoBundle 'tpope/vim-haml'
+NeoBundle 'vim-ruby/vim-ruby'
 
 filetype plugin indent on

いじるポイントとしては、

  • set runtimepath+= にneobundle.vimのパスを設定
  • call neobundle#rc にプラグインを入れたいパスを指定
  • BundleをNeoBundleに変更

あとは、

vimで、NeoBundleInstallをすればOK!

Vundleとの違いでいいなぁと思う点は、紹介記事にもあるように

  • Subversionなどにも対応しているため、vim.orgとgithub.comに縛られない
  • プラグインのリビジョンを指定することも可能! ←これ重要!
  • NeoBundleCleanで、プラグインの削除も簡単

ということで、また一つShougoさん++な環境になりました。