Exploring files and directories in vim with the NERD tree plugin

Exploring, opening, switching, renaming, moving files and directories are common tasks performed during coding. In IDEs it is usually achieved with some kind of filesystem explorer. In vim I preffer to use the NERD tree plugin.

NERD tree plugin for vim

NERD Tree features

NERD tree enables you to:

Installation

Get the source from the plugin website and unzip it into your ~/.vim directory.

To make using NERD tree more convenient it's best to create a shortcut mapping. To use ctrl+n add the following line to your ~/.vimrc file:

nmap <silent> <c-n> :NERDTreeToggle<CR>

Usage

Run vim and type :NERDTreeToggle or ctrl+n. The later will work only if you've created a mapping. NERD tree should open and present you the directory structure.

I'd suggest you to start with pressing the ? to read a quick help and learn about the plugin features.

Comments