Vim 在文件夹查看模式下更改配置
当我在路径上按 gf 进入 vim 中的文件夹时, 我进入某种文件夹查看模式。
例如,我没有自动设置行号。
如何更改 Vim 中文件夹查看模式的配置?
When I enter a folder in vim by pressing gf while over a path,
I enter some kind of folder viewing mode.
I don't have for instance, line numbers set in it automatically.
How do i change the configuration for the folder viewing mode in Vim?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您引用的路径是目录,vim 将使用其内置文件浏览器。
因此:
用
|
代表光标,如果使用“gf”,这将产生与以下相同的结果:或者
它将探索当前缓冲区所在路径的目录。
有许多可用的插件可以显示不同的目录视图(最著名的可能是 NERDTree),但默认的文件资源管理器就是这样。据我所知,除了将
gf
映射到另一个函数或命令之外,没有办法改变这种行为。有关默认文件资源管理器的更多信息,请尝试
:help :Explore
,它显示了一些选项,例如在拆分中打开资源管理器、新选项卡、查看文件信息等。If the path you're referencing is a directory, vim will use its builtin filebrowser.
thus:
with
|
representing the cursor, if one uses "gf", this will produce the same results as:or
which will explore the directory of the path the current buffer is in.
There are a number of plugins available which show different views for directories (most notably perhaps, NERDTree), but the default file explorer is simply what it is. To my knowledge, there's no way to change this behavior, aside from mapping
gf
to another function or command.for more information on the default file explorer, try
:help :Explore
, which shows the options of doing things like opening the explorer in a split, a new tab, seeing file information, etc.