ゆるーい備忘録

まいにちべんきょう

Vimのプラグイン管理ツール「neobundle」をインストールした話

neobundleをインストールするぞ

参考サイト

http://yukihir0.hatenablog.jp/entry/2013/08/17/222339 http://holypp.hatenablog.com/entry/20110321/1300722152

やること

設定ファイルをGit管理する

vimの設定ファイルは~/.vimrc これをGit管理して、会社のPCでも共有できるようにする。

具体的には、dotfilesというgit管理用のディレクトリを作成して、~/.vimrcを一度移動させ そのあとシンボリックで~/.vimrcをdotfiles/.vimrcに向ける

$ cd ~
$ mkdir dotfiles
$ mv .vimrc dotfiles
$ mv .bash_profile dotfiles
$ mv .vim dotfiles

シンボリック作成

$ ln -s dotfiles/.vimrc .vimrc
$ ln -s dotfiles/.bash_profile .bash_profile
$ ln -s dotfiles/.vim .vim

git remote登録

$ git remote add origin git@github.com:harurururu/dotfiles.git
$ git push origin master

neobundle install

$ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh > install.sh
$ chmod u+x install.sh
$ ./install.sh

install.shを実行すると~/.vim/bundleができる

プラグインを使えるようにする

$ vim ~/.vimrc

こちらのサイトに記載があるvimrcの中身をコピぺする

http://qiita.com/puriketu99/items/1c32d3f24cc2919203eb

一回:wqで保存終了し、もう一度vimをたちあげる。 ノーマルモードで、:NeoBundleInstall とするとプラグインのインストールができる。。。はずだった

Error detected while processing /Users/uchidaharuka/.vimrc:
line   10:
E117: Unknown function: neobundle#begin
line   14:
E492: Not an editor command: NeoBundleFetch 'Shougo/neobundle.vim'
line   17:
E492: Not an editor command: NeoBundle 'Shougo/neosnippet.vim'
line   18:
E492: Not an editor command: NeoBundle 'Shougo/neosnippet-snippets'
line   19:
E492: Not an editor command: NeoBundle 'tpope/vim-fugitive'
line   20:
E492: Not an editor command: NeoBundle 'ctrlpvim/ctrlp.vim'
line   21:
E492: Not an editor command: NeoBundle 'flazz/vim-colorschemes'
line   24:
E492: Not an editor command: NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
line   27:
E117: Unknown function: neobundle#end
line   34:
E492: Not an editor command: NeoBundleCheck
Press ENTER or type command to continue

なんだかすごい量のえらーが。。。 vimrcを見直してみる。

set runtimepath^=/home/vagrant/.vim/bundle/neobundle.vim/

このパスがあやしいので、以下に変更

set runtimepath^=~/.vim/bundle/neobundle.vim/

再度vimを起動し、:NeoBundleInstallと打つ

すると、/.vim/bundle/以下にプラグインファイルが追加される! 設定完了!