我通常:

选择所需的文件。 在一个选项卡中打开它(默认为t字符)。

但是我怎么能跳回NERDTree在一个选项卡中打开一个文件呢?

我现在在我的.vimrc文件中使用的临时解决方案:

map <F10> :NERDTree /path/to/root/of/my/project

但是从根目录反复开始导航并不是很有用。


当前回答

NERDTree opens up in another window. That split view you're seeing? They're called windows in vim parlance. All the window commands start with CTRL-W. To move from adjacent windows that are left and right of one another, you can change focus to the window to the left of your current window with CTRL-w h, and move focus to the right with CTRL-w l. Likewise, CTRL-w j and CTRL-w k will move you between horizontally split windows (i.e., one window is above the other). There's a lot more you can do with windows as described here.

你也可以使用:NERDTreeToggle命令来打开和关闭你的树。我通常把它绑定为t。

其他回答

ctrl-ww可能是有用的,当你有有限的选项卡打开。但当你打开太多标签时,可能会很烦人。

我再次输入:NERDTree,立即将焦点放在NERDTree选项卡上,无论光标的焦点在哪里。希望这能有所帮助

在NERDTree的最新版本中,您可以使用命令:NERDTreeFocus,这将把焦点移动到NERDTree窗口。

所有的快捷方式和功能都在

按CTRL - ?

Ctrl-ww

这将在打开的窗口之间移动(因此您可以在NERDTree窗口,您正在编辑的文件和帮助窗口之间跳转,例如……只需按住Ctrl键并按w两次)。

您可以使用# ctrl-ww来关注一个分割窗口。

例如,按:

1 ctrl-ww

会关注第一个窗口,通常是NERDTree。