Vim trick - how to view a directory as a "folder"?

I worked on an ubuntu terminal and accidentally "vim-ed" in a folder instead of cd-ing. Somehow it displayed a window displaying the contents of the directory as if it were a folder on the desktop. So how do I do this again?

+5
source share
2 answers

By default, vim opens directories to the buffer using the built-in plugin netrw. See :help netrwfor information. In addition, many users, such as other plugins, such as NERDTree , edit directories. You can edit the folder using

:e /path/to/directory

or by opening it directly when starting vim:

vim /path/to/directory
+5
source

If this is a directory:

/some/directory/on/filesystem/

You are just a vimdirectory:

vim /some/directory/on/filesystem

* nix . . , stackoverflow .

+2

All Articles