我通常:

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

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

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

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

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


当前回答

如果您使用T而不是T,则不需要回跳,因为新选项卡将被打开,但vim的焦点将简单地保留在NERDTree中。

其他回答

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窗口。

如果您使用T而不是T,则不需要回跳,因为新选项卡将被打开,但vim的焦点将简单地保留在NERDTree中。

您可以通过ctrl-pgup和ctrl-pgdown来更改选项卡。在你来自NERDTree的选项卡上仍然被选中,你可以打开另一个选项卡。