September 10, 2018

The Vim "NERDtree" plugin

A plugin called NERDtree is quite popular, and is often used along with taglist. I followed the advice of several people and activated the setting to put the taglist column on the right, leaving room on the left for the column from NERDtree. I also added a mapping to let the F4 key map to the :NERDTreeToggle command. One follow says he binds this to the "t" key, which is a seldom used vim motion command.
Another fellow says:

"I put project.vim, taglist, and NERDTree on , , and , respectively."

Installing NERDtree

I try using the Vundle ":PluginSearch! nerd" and get the following choices:
Plugin 'nerdtree-ack'
Plugin 'NERD_Tree-and-ack'
Plugin 'FindInNERDTree'
Plugin 'NERD_tree-Project'
Plugin 'The-NERD-tree'
Plugin 'The-NERD-Commenter'
Nothing is just called NERDtree, but near as I can tell "The-NERD_tree" is what I want. This comes from vim.org. I use the Vundle searcher, then fall back on Google to try to figure out what all these darn things are. After this, I exit the editor and do an "ls .vimrc/bundle" to find out what this is called, then add the following to my .vimrc. I am ignoring these Ack augmented NERDtree things for now.
Plugin 'The-NERD-tree'
Nowwhere do I find anything entitled (or functionally equivalent to) "how do I use this darn thing?". The FAQ suggests mapping Control-n to the nerd tree toggle (which is sort of logical, "n" for nerdtree).
map  :NERDTreeToggle
nnoremap  :NERDTreeToggle
I actually do both, but use nnoremap for both. Also, I add the following to put the taglist stuff on the right:
let Tlist_Use_Right_Window   = 1
Also note that there are switches available for both taglist and nerdtree so they will come up whenever vim is launched. With a large (24 inch) wide aspect display (like most folks have these days) there is plenty of room for both of these and an editing windown in the middle.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org