Navigating file trees
Since software projects contain a lot of files and directories, finding a way to traverse and display these using Vim comes in handy. This section will cover five different ways that you can navigate your files: using the built-in Netrw file manager or using the :e
command with the wildmenu
option enabled, as well as using the NERDTree, Vinegar, and CtrlP plugins. All of these provide different ways to interact with files and can be mixed and matched.
Netrw
Netrw is a built-in file manager in Vim (if we want to get technical, it’s a plugin that ships with Vim). It allows you to browse directories and functions, similar to any other file manager you’ve worked with in your favorite OS.
Use :Ex
(the full command is :Explore
) to open the file navigation window:
Figure 2.17 – Netrw file manager window, with a handy help screen above the directory tree.
Netrw is native to Vim
Netrw is fully integrated with...