NERDTree 重新加载新文件
如果我将一个文件添加到在 NERDTree 中打开的同一目录中,我可以看到添加的文件的唯一方法是退出 vim 并再次启动它。
有没有办法可以重新加载 NERDTree 中的文件?
If I add a file to the same directory opened in NERDTree
, the only way I can see the file added is if I quit vim and start it again .
Is there a way I can reload the files in NERDTree
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以关闭并重新打开 NERDTree,或者只需点击 r 刷新当前目录的列表,或点击 R 刷新根目录的列表。
您是否在 NERDTree 窗口顶部看到“按 ? 寻求帮助”?这意味着您可以按 ? 寻求帮助。如果这样做,您将看到 NERDTree 快捷方式的详尽列表。这很整洁。
更一般地说,许多插件都有完整的文档,您可以使用
:help
访问这些文档。You could close and reopen NERDTree or simply hit r to refresh the current directory's listing or R to refresh the root directory's listing .
Do you see "Press ? for help" at the top of the NERDTree window? It means that you can press ? for help. If you do, you will see an exhaustive listing of NERDTree shortcuts. That's neat.
More generally, many plugins have a thorough documentation that you can access with
:help <pluginame>
.正如@romainl 上面回答的那样;按r刷新当前目录或按R刷新根目录。
您可以考虑从 nerdTree 本身添加新文件,方法是按 m,然后按 a 添加新文件(或通过添加尾部斜杠来添加目录)。这样你就不需要刷新 nerdTree 来查看新添加的文件。
As @romainl answered above; press r to refresh current directory or R to refresh root directory.
You can consider adding new files from nerdTree itself by pressing m, then a to add a new file (or directory by adding a trailing slash). This way you don't need to refresh nerdTree to see the new added file.
刷新 NERDTree
我没有在
NERDTree
窗口中点击 R,而是使用自定义地图来完成此操作:我已将其映射到 Leader + r,但您可以将其映射到您想要的任何内容。
解释:
NERDTree
窗口R
键)注意:您可以添加最后一步刷新 CtrlP 以及NERDTree
Refresh NERDTree
Instead of hitting R in the
NERDTree
window, I use a custom map that does it for me:I've mapped it to Leader + r, but you can map it to whatever you want.
Explanation:
NERDTree
windowR
key)Note: You can add a last step to refresh CtrlP along with NERDTree
您可以使用 feedkeys 功能点击 R 按钮。就像这样:
我在 .vimrc 文件中定义了一个函数:
因此,当我输入 ctrl+l 时,NERDTree 将被切换并刷新根目录。
You can hit R button by using feedkeys function. Just like this:
I have defined a function in my .vimrc file:
So, when I type ctrl+l, the NERDTree will be toggled and refresh root directory.
就我个人而言,我更喜欢在聚焦 NERDTree 窗口时自动触发刷新。这个自动命令(在您的
.vimrc
中)将执行此操作autocmd BufEnter NERD_tree_* |执行“普通R”
Personally I prefer to trigger the refresh automatically when focusing the NERDTree window. This autocommand (in your
.vimrc
) will do itautocmd BufEnter NERD_tree_* | execute 'normal R'