DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Notes about NERDTree


NERDTree is the best file explorer for vim so far.

NERDTree configuration in .vimrc

" NerdTree
" define open/close shortcut
map <C-n> :NERDTreeToggle<CR>
" open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" close NERDTree when all files closed:
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif

Keyboard shortcut list

Frequently Used Keys

?: open/close shortcut key list P: back to root O: expand all nodes recursively X: close all child nodes recursively C-w < (or >): resize window width

All keys

C: make current folder the root; t: Open selected node/bookmark in a new tab T: Same as 't' but keep the focus on the current tab ?: Toogle Help C-n C-n: Toogle focus between files and NERDTree /: find a file, like plane text file

I: toogle show/hide hiden files ?: toggle quick help; o: toggle fold/unfold; O: unfold to leaf; x: fold parent; u: make root up 1 level; r: refresh current dir; m: show menu(about dir manipulation): mkdir/rm/move cd: change working dir to current selected dir; F: toggle show/hide files; B: toggle bookmark table; q: close NERDTree window; A: Max/Restore NERDTree window; P: goto the root; p: goto the parent; Bookmark is persistent. So you can reopen it after you leaving vim. :Bookmark : set bookmark(dir or file) :OpenBookmark : open file :ClearBookmark: as is D: delete bookmark(when cursor in bookmark table)



Published

Jan 15, 2013

Last Updated

Jan 15, 2013

Category

Tech

Tags

  • plugin 16
  • Vim 92

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor