はじめに

mac環境では問題なかったんですがcentosのvim上で[ :NeoBundleUpdate ]を実行した時に、エラーがプラグイン数の数だけでてしまったので調べてみました。

事象の原因と解決まで

もともとのneobundleの設定とvimrcの設定状況から解決案までです。

neobundle.vimの導入

gitでneobundle.vimをcloneしておきます

mkdir -p ~/.vim/bundle
cd ~/.vim/
git clone https://github.com/Shougo/neobundle.vim.git neobundle.vim

エラー時の.vimrcの記述

cloneしたneobundle.vimを読み込みます

filetype off

if has(‘vim_starting’)
 set runtimepath+=~/.vim/neobundle.vim
 call neobundle#rc(expand(‘~/.vim/.bundle’))
endif

NeoBundle hoge1
NeoBundle hoge2
NeoBundle hoge3

filetype plugin on
filetype plugin on

※NeoBundleのhogeはいずれかのプラグインです

原因?

エラー内容から、neobundle#beginとneobundle#endのブロック間でneobundleをコールするようにとのことです。

エラー内容:

NeoBundle` commands must be executed within a neobundle#begin/end block.

今まで出ていなかったのに、centos環境でなぜでたのか、バージョン?仕様変更?
NeoBundleのバージョンにより仕様がかわった?とかでしょうか。

参考:
https://teratail.com/questions/9759

解決

.vimrcをエラーの通りbeginとendで囲ってやります

filetype off

if has(‘vim_starting’)
 set runtimepath+=~/.vim/neobundle.vim
 call neobundle#begin(expand(‘~/.vim/.bundle’))
endif

NeoBundle hoge1
NeoBundle hoge2
NeoBundle hoge3

call neobundle#end()

filetype plugin on
filetype plugin on

再度vim上で[ :NeoBundleUpdate ]でエラーがでなくなりました。難しいですね。

その他おすすめの備忘録

Tagged with:
 

コメントを残す