Set up NERDTree for vim

I can’t use vim without NERDTree. This is how to set it up:

pathogen.vim

You need pathogen.vim to load the NERDTree plugin.

1
2
3
4
mkdir -p ~/.vim/autoload ~/.vim/bundle
cd ~/.vim/autoload
wget https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim
vim ~/.vimrc

Add this to the .vimrc file:

1
2
3
4
5
6
call pathogen#infect()
map <C-n> :NERDTreeToggle<CR>
set softtabstop=4
set expandtab
set cindent

Save and exit.

NERDTree

1
2
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git

All done! Hit ctrl-n to toggle the tree view.