Vim 在文件夹查看模式下更改配置

发布于 2024-09-07 03:38:18 字数 98 浏览 1 评论 0原文

当我在路径上按 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微凉徒眸意 2024-09-14 03:38:18

如果您引用的路径是目录,vim 将使用其内置文件浏览器。

因此:

doSeomthing(mypath = '/home/nate/superAwesome|Project/')

| 代表光标,如果使用“gf”,这将产生与以下相同的结果:

:e /home/nate/superAwesomeProject/

或者

:Explore

它将探索当前缓冲区所在路径的目录。

有许多可用的插件可以显示不同的目录视图(最著名的可能是 NERDTree),但默认的文件资源管理器就是这样。据我所知,除了将 gf 映射到另一个函数或命令之外,没有办法改变这种行为。

有关默认文件资源管理器的更多信息,请尝试 :help :Explore,它显示了一些选项,例如在拆分中打开资源管理器、新选项卡、查看文件信息等。

If the path you're referencing is a directory, vim will use its builtin filebrowser.

thus:

doSeomthing(mypath = '/home/nate/superAwesome|Project/')

with | representing the cursor, if one uses "gf", this will produce the same results as:

:e /home/nate/superAwesomeProject/

or

:Explore

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文