LoginSignup
4
2

More than 5 years have passed since last update.

git commit, git mergeの時にvimのエラーが出る

Posted at

gitを使う際、GUIとCUIどちらが良いかというのは色々とご意見があると思いますが、私はCUI派です。
そんな私がgitを使う時に出くわしたエラーの対処についてを今回記事にしました。

エラー内容

vagrantで仮想環境を作成して開発しているのですが、git commitやgit mergeするといつもこんなエラーが出てました。
ぶっちゃけEnterキーを押せば無理矢理編集できたので2ヶ月くらい放置してた

Error detected while processing /home/vagrant/.vimrc:
line   91:
E492: Not an editor command: NeoBundleFetch 'Shougo/neobundle.vim'
line   95:
E492: Not an editor command: NeoBundle 'itchyny/lightline.vim'
line   96:
E492: Not an editor command: NeoBundle 'bronson/vim-trailing-whitespace'
line   97:
E492: Not an editor command: NeoBundle 'Yggdroot/indentLine'
line   98:
E492: Not an editor command: NeoBundle 'scrooloose/nerdtree'
line   99:
E492: Not an editor command: NeoBundle 'ctrlpvim/ctrlp.vim'
line  100:
E492: Not an editor command: NeoBundle 'tacahiroy/ctrlp-funky'
line  109:
E492: Not an editor command: NeoBundleCheck
Press ENTER or type command to continue

初めは、.vimrcを色々とイジっているのでその影響かな、とか思ってましたが…

意外と解決方法が見つからない

はい、意外と解決方法が見つかりませんでした。
このteratailの質問とかを参考に.vimrcに記述しているset runtimepath+=~/.vim/bundle/neobundle.vim/の部分を絶対パスにしたりしてもダメでした。

解決方法--gitのデフォルトエディタはvi

vimについて色々と調べても埒が明かなかったので、gitについて調べてみると、なんとgitのデフォルトエディタはvimではなくviでした…
なので、以下のように設定した後は、上記のエラーは出てきませんでした。

$ git config --global core.editor "vim"
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2