最近よく見る Vim のトラブル対応のまとめ・フリーズ、neobundle#rc() is removed function 、neobundle directory is empty 、neosnippet-snippets 、emmet-vim

最近よく見る Vim のトラブル対応のまとめ・フリーズ、neobundle#rc() is removed function 、neobundle directory is empty 、neosnippet-snippets 、emmet-vim

Vim、言わずと知れたプログラマ御用達のテキストエディタ。アスキー書籍の「実践Vim」を手に入れてから生産性うpがハンパないので愛用していたのだが、あれ、なんか Vim がフリーズする・・・と思ってトラブル対応してたら立て続けにバグや仕様変更に出くわしたので、その現象と対応のまとめをメモっておく。

Vim がフリーズ(暴走)する

事の発端は、なんだかよくわからんが Vim 使って編集していると 固まるのに気がついた。

Vim が固まる原因

いろいろググった結果 Vim のプラグイン neocomplcache のバグで無限ループに入っちゃうことがあるらしい。

github.com

↑ここで何やら香ばしい会話がされてますが、そういうことらしいです。

Vim がフリーズ・解決方法

neocomplcache のバグで、すでに修正版が公開されてるとのことで NeoBundleUpdate で治りました。

github.com

neobundle#rc() is removed function

・・・と、思って NeoBundleUpdate したら、Vim を起動した瞬間

neobundle#rc() is removed function

とか

neobundle directory is empty

とかってエラーがザクザク出てきた・・・

neobundle#rc() is removed function の原因

NeoBundleUpdate によって NeoBundle 自体も最新版になるわけですが、neobundle#rc() の部分は仕様が変わって neobundle#begin とneobundle#end と書くようになったらしい。
よく見たらエラーメッセージにも書いてあるじゃん。

[neobundle] NeoBundle commands must be executed within a neobundle#begin/end block. Please check your usage.
[neobundle] neobundle directory is empty.

neobundle#rc() is removed function の解決方法

上のエラーメッセージにあるように、.vimrc の NeoBundle 関係の記述の部分で、neobundle#rc() で始まっていた部分を、以下のように変更します。

call neobundle#begin(expand(‘~/.vim/bundle’)) <– neobundle#rc() で始まってた部分を変更する

NeoBundleFetch ‘Shougo/neobundle.vim’
NeoBundle ‘someone/hogehoge-plugin’

call neobundle#end() <– neobundle#end() で挟む

You must install neosnippet-snippets or disable runtime snippets

無事に NeoBundleUpdate が完了して起動もできると思ったら今度は、

You must install neosnippet-snippets or disable runtime snippets.

とか。

You must install neosnippet-snippets or disable runtime snippets 原因

neosnippet が使用するデフォルトのスニペットを定義した、いわば辞書のような存在が neosnippet-snippets で、これが必要になったらしい。

Notes:
Default snippets files are available in: neosnippet-snippets
Installing default snippets is optional. If choose not to install them, you must deactivate them with g:neosnippet#disable_runtime_snippets.
neocomplcache/neocomplete is not required to use neosnippet, but it’s highly recommended.
Extra snippets files can be found in: vim-snippets.
GitHub - Shougo/neosnippet.vim: neo-snippet plugin contains neocomplcache snippets source より

You must install neosnippet-snippets or disable runtime snippets 解決方法

neosnippet-snippets をNeoBundleInstall して解決した。

.vimrc に
NeoBundle ‘Shougo/neosnippet-snippets’
を追加して NeoBundleInstall

Unfortunately, zencoding-vim was moved to emmet-vim, please use it

しばらく正常に動作してるので、ようやくちゃんと動くようになったと思ったら、今度は html 編集してる時にこんなエラーが。

Unfortunately, zencoding-vim was moved to emmet-vim, please use it.

Unfortunately, zencoding-vim was moved to emmet-vim, please use it 原因

これはもうエラーコードまんまで、zencoding-vim はemmet-vim になった、ということ。

github.com

Unfortunately, zencoding-vim was moved to emmet-vim, please use it 解決方法

zencoding-vim をやめて emmet-vim をインストールして解決。

.vimrc に
NeoBundleLazy ‘mattn/zencoding-vim’, {“autoload”: {“filetypes”: ‘html’}} <– これをやめて
NeoBundleLazy ‘mattn/emmet-vim’, {“autoload”: {“filetypes”: ‘html’}} <– これを追加
して NeoBundleUpdate