现象为在切换文件或tab,在NERD_tree与编辑区切换时,弹出一个如图的错误:
处理 function <SNR>32_BEActivateBuffer 时发生错误
第 18 行:
E684:List 索引超出范围:2
用英语搜索 vim ActivateBuffer E684 等信息,查出是插件 bufexplorer 的问题,但是已经确认安装是最新的。
找到了一个解决办法(http://c9s.blogspot.com/2012/07/patch-for-bufexplorervim.html):
diff --git a/plugin/bufexplorer.vim b/plugin/bufexplorer.vim index 8791363..6024bf7 100644 --- a/plugin/bufexplorer.vim +++ b/plugin/bufexplorer.vim @@ -183,7 +183,10 @@ function! s:BEActivateBuffer() elseif empty(l) || index(l, b) == -1 " Add new buffer to this tab buffer list let l = add(l, b) - let s:tabSpace[tabpagenr()] = l + + " note: it will be out of range + " original solution: let s:tabSpace[tabpagenr()] = l + call add(s:tabSpace, l ) if g:bufExplorerOnlyOneTab == 1 " If a buffer can only be available in 1 tab page