Using Vim with NERD Tree
Vim is a powerful text editor based on the venerable vi, originated with UNIX. Vim is nowadays a multi platform product. I use it on Mac OS X, Linux and Windows. In all these platforms it has a native look-and-feel, and offers all features that we came to expect from it.
One of the things that developers need is an easy to way to access files. Traditional editors have a simple open dialog. More advanced IDEs, however, have a project area where a list of files is displayed.
In Vim there is no out-of-the box way of doing this, but you can simulate these features using freely available plug-ins.
The plug-in that I found to be the most useful when working with multiple files is called NERD Tree. This plug-in is freely downloadable from the Vim web site.
The main advantage of nerd tree is that it displays as a sidebar on the main Vim interface. That is, one can just start NERD tree with a command and have it display the full list of files that you are working on for a project, for example.
Lets say you are writing an application that has a main src directory, as it is so common. You can use NERD tree as a list of files from that directory. The list stays on the left side of your screen in a vertical table. That way, you can have access to all these files with a double click, or you can use the enter key when the cursor is over the file name.
The other advantage of NERD tree is that is has easy ways to explore the file system. For example you can restrict the list of files displayed to hide directories as well as files with a leading dot.
Using NERD tree has been one of the ways Vim can saved me lots of time. It is similar to have the features of an advanced IDE in a simple text file that I can search and jump to using only the keyboard.
And, as all things related to Vim, it is easy to extend and use. Which looks looks to me as a win-win situation.
Similar Posts:
About the Author
Carlos Oliveira holds a PhD in Systems Engineering and Optimization from University of Florida. He works as a software engineer, with more than 10 years of experience in developing high performance, commercial and scientific applications in C++, Java, and Objective-C. His most Recent Book is Practical C++ Financial Programming.