The NerdTree is a vim plugin that enables us to explore files within vim.

Installation

To install NERDTree you can use Vundle with adding this to your .vimrc:

Plugin 'scrooloose/nerdtree'

Usage

All you need to do is either use vim command :NERDTree or map vim-command with Ctrl+n (or other combination):

nmap <C-n> :NERDTreeToggle<CR>

To learn some of the NERDTree key-combinations check the "?" sign at NERDTree, here is what you will find:

" NERDTree (5.0.0) quickhelp~
" ============================
" File node mappings~
" double-click,
" <CR>,
" o: open in current window
" t: open in new tab
" T: open in new tab silently
" middle-click,
" i: open split
" gi: preview split
" s: open vsplit
" gs: preview vsplit
"
" ----------------------------
" Directory node mappings~
" double-click,
" o: open & close node
" O: recursively open node
" t: open in new tab
" T: open in new tab silently
" x: close parent of node
" X: close all child nodes of
"    current node recursively
" middle-click,
" e: explore selected dir
"
" ----------------------------
" Bookmark table mappings~
" double-click,
" o: open bookmark
" t: open in new tab
" T: open in new tab silently
" D: delete bookmark
"
" ----------------------------
" Tree navigation mappings~
" P: go to root
" p: go to parent
" K: go to first child
" J: go to last child
" <C-j>: go to next sibling
" <C-k>: go to prev sibling
"
" ----------------------------
" Filesystem mappings~
" C: change tree root to the
"    selected dir
" u: move tree root up a dir
" U: move tree root up a dir
"    but leave old root open
" r: refresh cursor dir
" R: refresh current root
" m: Show menu
" cd:change the CWD to the
"    selected dir
" CD:change tree root to CWD
"
" ----------------------------
" Tree filtering mappings~
" I: hidden files (off)
" f: file filters (on)
" F: files (on)
" B: bookmarks (off)
"
" ----------------------------
" Custom mappings~
"
" ----------------------------
" Other mappings~
" q: Close the NERDTree window
" A: Zoom (maximize-minimize)
"    the NERDTree window
" ?: toggle help

Acknowledgements

Thanks!

That's it :) Comment, share or don't - up to you.

Any suggestions what I should blog about? Post me a comment in the box below or poke me at Twitter: @anselmos88.

See you in the next episode! Cheers!



Comments

comments powered by Disqus