使nerdtree从未打开第三个窗口

时间:2011-11-30 09:27:27

标签: vim nerdtree

使用NERDTree时,我经常遇到关闭所有现有缓冲区(NERDTree缓冲区除外)的情况,然后再次从NERDTree开始填充fils。

执行此操作时,NERDTree会在新的拆分窗口中打开文件,即左侧有NERDTree,右侧有两个窗口,一个emtpy缓冲区和我要打开的文件。

我想要发生的是NERDTree在右侧窗口中打开文件而不拆分它。

有没有办法告诉NERDTree永远不要打开一个新窗口,如果已经可以使用它?我尝试使用“o”命令,但这与Enter命令完全相同。

2 个答案:

答案 0 :(得分:0)

您是否检查过文档中的所有映射

o.......Open files, directories and bookmarks....................|NERDTree-o|

go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|

t.......Open selected node/bookmark in a new tab.................|NERDTree-t|

T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|

i.......Open selected file in a split window.....................|NERDTree-i|

gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|

s.......Open selected file in a new vsplit.......................|NERDTree-s|

gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

x.......Close the current nodes parent...........................|NERDTree-x|

X.......Recursively close all children of the current node.......|NERDTree-X|

e.......Edit the current dif.....................................|NERDTree-e|

答案 1 :(得分:0)

我终于到处查看了nerdtree代码,我找到了解决问题的方法:我不得不更改插件。

我在github上为我的更改创建了一个pull请求: https://github.com/scrooloose/nerdtree/pull/102

更新:实际上,问题是我使用的set buftype=nofile脚本用于空缓冲区(它应该set buftype=)。改变之后,我的问题就消失了。