Download and configure
The official address of the Nerdtree plugin is as follows, and you can get the latest version from here
Https://github.com/scrooloose/nerdtree Download Zip installation package
Or use the following official website source file installation method
My lab environment is centos6.6, and the other versions may be a little different.
Installation method is very simple, first download the compressed file, unzip the plugin directory under the Nerd_tree.vim copy ~/.vim/plugin and the nerd_tree.txt copy of the doc directory to ~/.vim/doc. ~ Represents the current user's directory, My environment does not have ~/.vim ~/.vim/plugin ~/.vim/doc, will be created later, if your version has, it is better.
wget http://www.vim.org/scripts/download_script.php?src_id=17123 -O nerdtree.zip unzip nerdtree.zipmkdir -p ~/.vim/{plugin,doc}cp plugin/NERD_tree.vim ~/.vim/plugin/cp doc/NERD_tree.txt ~/.vim/doc/
After installation, enter VIM on the command line, open vim, enter in vim: Nerdtree, you can see the effect of nerdtree.
For the sake of convenience, let's set up a shortcut key to add the following to the ~/.VIMRC file.
My centos6.6 still does not have this ~/.VIMRC, it doesn't matter, create a, direct
vim ~/.vimrc
And then add
" NERDTreemap <F10> :NERDTreeToggle<CR>
When you turn on VIM, you can display and hide Nerdtree file browsing by pressing F10 on the keyboard.
Only will F10, that also too no technical content, below is another wave of shortcut keys, learn it.
Shortcut
Switching tables and directories
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 move in left right window when Layout position of the front window o open a file, directory, or bookmark in an existing window and jump to the window to open a file, directory, or bookmark in an existing window, but do not jump to the window to open the selected file/bookmark in the new tab and jump to the new Tabt in the new tab Open selected file/bookmark, but do not jump to new Tabi 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 that 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 that window! Executes the current file o recursively open all directories under the selected node x close the parent directory of the selected node x recursively closes all directories under the selected node E Edit the current DIF double-click equivalent Nerdtree-o middle key On the file equivalent to Nerdtree-i, the directory equivalent to nerdtree-ed delete the current bookmark p jumps to the root node P jumps to the parent node K jumps to the first node in the current directory sibling J jumps to the last sibling of the current directory Node k jumps to the previous node of the same sibling in the current directory J jumps to the next node of the same sibling in the current directory. 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, and becomes the closing root node. The parent directory is set to the root directory, but keep expanding the original root node R recursive Refresh selected directory r recursive refresh root node m display file system menu CD set CWD to selected directory I toggle show hidden file F Toggle Whether file filtering is used F Toggle Show file B Toggle Show bookmark Q Close Nerdtree window? Toggle whether Quick help
is displayed
Toggle tab Page
:tabnew [++opt选项] [+cmd] 文件 建立对指定文件新的tab:tabc 关闭当前的 tab:tabo 关闭所有其他的 tab:tabs 查看所有打开的 tab:tabp 前一个 tab:tabn 后一个 tab
Standard mode:
gT 前一个 tabgt 后一个 tabMacVim 还可以借助快捷键来完成 tab 的关闭、切换cmd+w 关闭当前的 tabcmd+{ 前一个 tabcmd+} 后一个 tabNerdTree 在 .vimrc 中的常用配置
"Nerdtree is turned on by default when Vim is started (Autocmd can be abbreviated as AU)
autocmd VimEnter * NERDTree
"Press F2 to bring up/hide Nerdtree
map :silent! NERDTreeToggle
"Set the Nerdtree window to the right of the Vim window (default to the left)
let NERDTreeWinPos="right"
"When you open the Nerdtree window, the Bookmarks is displayed automatically
let NERDTreeShowBookmarks=1
Vim plugin: Display tree Catalog plugin Nerdtree installation and use