john-jones
john-jones

Reputation: 7780

Vim change configuration in folder viewing mode

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?

Upvotes: 2

Views: 705

Answers (1)

sleepynate
sleepynate

Reputation: 8036

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.

Upvotes: 4

Related Questions