Download and configure
The official address of the Nerdtree plugin is as follows, you can get the latest version https://github.com/scrooloose/nerdtree download ZIP installation package or use the following website source file installation method
My experimental environment is centos6.6, and other versions may be somewhat different. Installation method is very simple, first download the compressed file, after decompression will be the plugin directory under the Nerd_tree.vim copy ~/.vim/plugin and Doc directory nerd_tree.txt copy to ~/.vim/doc. ~ Represents the directory of the current user, There is no ~/.vim ~/.vim/plugin ~/.vim/doc in my environment and will be created later, if your version has it, that's better.
wget Http://www.vim.org/scripts/download_script.php?src_id=17123-O nerdtree.zip
unzip nerdtree.zip
mkdir- P ~/.vim/{plugin,doc}
CP plugin/nerd_tree.vim ~/.vim/plugin/
CP doc/nerd_tree.txt ~/.vim/doc/
After installation, the command line input vim, open vim, in vim input: Nerdtree, you can see the effect of nerdtree.
For convenience, we set the shortcut key, add the following content in the ~/.VIMRC file, my centos6.6 still does not have this ~/.VIMRC, OK, create a, direct vim ~/.VIMRC then add "nerdtree map <F10 >:nerdtreetoggle<cr> This open vim, as long as the keyboard on the F10 can show and hide Nerdtree file browsing.
Will only F10, that also is too no technical content, the following is a wave shortcut key, study it. Shortcuts
Switch workbench and Table of contents
CTRL + W + H cursor focus left Tree Directory Ctrl + W + L cursor focus right file Display window Ctrl + W + W cursor automatically toggle Ctrl + W + R on left right window to move the current window layout position o Open a file, table of contents, or bookmark in an existing window and skip to this window go open a file, directory, or bookmark in an existing window, but do not skip to the window T opens the selected file/bookmark in the new tab and jumps to the new tab to open the check in the new tab File/bookmark, but do not jump to new Tab I split a new window opens the selected file and jumps to the window GI split a new window opens the selected file, but does not jump to the window s vsplit a new window opens the selected file and jumps to that window GS Vsplit A new window opens the selected file, but does not jump to the window! Execute current file O recursively open all directories under selected node X fold the parent directory of the selected node x recursion all the directories under selected nodes e Edit the current DIF double click the equivalent nerdtree- o Middle key to the file equivalent to Nerdtree-i, to the directory equivalent to NERDTREE-E D delete the current bookmark p jump to the root node P jump to the parent node K jump to the current directory the same sibling's first node J jump to when The last node of the same sibling under the previous directory K jumps to the previous node of the same sibling under the current directory J jumps to the following node in the current directory point C sets the parent directory of the selected directory or selected file to the root node u sets the parent directory of the current root node to the root directory. and becomes the closure of the original root knot Point U Sets the parent directory of the current root node to the root directory, but keep expanding the original root node R recursive Refresh Select directory r recursive refresh root node m show file system Menu CD set CWD to select Directory I toggle to show hidden Hidden file F Toggle whether to use file filter F Toggle show file B Toggle Show bookmark Q Close Nerdtree window?
Toggle whether to show Quick help
Toggle tab Page
: tabnew [++opt options] [+cmd] File Creates a new tab to the specified file:
tabc Closes the current tab:
Tabo closes all other tabs
: Tabs View all open tab
: TABP previous tab
: Tabn after a tab
Standard mode: GT before a tab GT a tab Macvim can also use shortcut keys to complete the tab closure, switch cmd+w Close the current tab cmd+{the previous tab cmd+} after a tab nerdtree in. vimrc The Common configuration
"When Vim starts, the default opens Nerdtree (Autocmd can be abbreviated as AU) autocmd vimenter * nerdtree" press F2 to pull up/hide Nerdtree map:silent! Nerdtreetoggle The Nerdtree window is set to the right of the Vim window (default is left) let nerdtreewinpos= "right" automatically displays the Bookmarks let Nerdt when the Nerdtree window is opened Reeshowbookmarks=1