Navigation and Context

Alex R. Young
usevim
Published in
2 min readAug 10, 2012

Most IDEs have a graphical drawer that displays a list of files and folders in a project. Although this is a slow way to navigate between files (hunting for a file visually rather than searching), it provides a useful representation of the project.

The Unix tree program

The Unix tree program is a command-line friendly alternative. It recursively lists files and directories, supports colourised output, and is available as a package on most systems.

I find tree a useful tool for visualising a project, but what about navigating between files using Vim? There are popular IDE-like file browser plugins, including NERDTree, vtreeexplorer, and project. NERDTree in particular offers a familiar interface that's easy to use even for Vim beginners.

NERDTree

However, visualising a project’s structure and finding files isn’t the end of the story. IDEs and editors also need to show us what we’re editing, and where we are in the file.

Vim’s statusline can show the current file, column and line number, and filesystem information. Rather than spending a lot of time tweaking the statusline setting, a plugin can be used instead. I like using Kim Silkebækken's Powerline which not only looks cool but also works well with Git.

That isn’t to say other options aren’t available — the beauty of Vim is that it can be easily customised to provide the level of navigational context and project visualisation that you require.

--

--