NerdTree - 显示树中的文件
是否有一个快捷方式可以显示 NerdTree 目录面板中的当前文件。
像 TextMate '在抽屉中显示文件' - Ctrl+Command+R
Is there a shortcut which reveal the current file in the NerdTree directory panel.
Like TextMate 'Reveal file in Drawer' - Ctrl+Command+R
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在 :h NERDTree 中:
我认为默认情况下它不会绑定到任何东西,所以你必须自己进行键绑定。
是我的 .vimrc 中出现的内容,以及
in :h NERDTree:
I don't think it's bound to anything by default, so you have to do a keybind yourself.
is what appears in my .vimrc, along with
看看这个,它会自动执行同步操作,每当您更改缓冲区时,nerdtree 都会自动刷新自己(我从 此处 进行微小修改)
Check this out, it automates the sync operation, whenever you change buffer, the nerdtree will automatically refreshed itself (I copied from here with tiny modifications)
这也可能只是一条评论。在当前版本中,切换 NerdTree 并使用 SyncTree 会导致 NERDTree 被调用两次。此修改似乎可以解决该问题:
This should also probably be just a comment. With the current version toggling NerdTree and using SyncTree causes NERDTree to be invoked twice. This modification seems to fix that problem:
陈如山的回答+评论对我来说非常有效,除了树打开的时候。通过此设置,打开树时将显示树中的当前文件。
Chen Rushan's answer + the comment worked perfectly well for me, except when the tree is open. With this setting, the current file in the tree will be revealed when the tree is opened.
赞同陈如山的帖子,不会
让NERDTree关闭。我找不到一个解决方案(除了下面的)可以突出显示 NERDTree 中当前打开的缓冲区,同时允许 NERDTree 切换。
下面是我在使用
Ctrl + ]
进行下一个缓冲区映射时,为了能够切换 NERDTree 并突出显示文件而收集的内容。希望其他人可以改进这一点。
To go along with Chen Rushan's post, the
won't let NERDTree close. I couldn't find a solution (other than below) that would highlight the current open buffer in NERDTree while allowing NERDTree to Toggle.
Below is what I scraped together to be able to toggle NERDTree and have files highlighted while using
Ctrl + ]
for my next buffer mapping.Hopefully others can improve this.