The NERD Tree

Source: Internet
Author: User

The NERD Tree

"Nerdtree-----------------------------

"Map a specific key or shortcut to open Nerdtree
Map <F3>:nerdtreetoggle<cr>
"Open Nerdtree with the current file selected
Nmap,t:nerdtreefind<cr>
"Don;t Show these file types
Let Nerdtreeignore = [' \.pyc$ ', ' \.pyo$ ']

Close Vim if the only window left open is a nerdtree

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif

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

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

<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 on left right Window Ctrl + W + R move Current window layout position o Open file, directory or bookmark in an existing window and jump to that window go in existing window You open a file, directory, or bookmark, but do not jump to the window in the newTab to open the selected file/bookmark and jump to the newTabt in the newtab Open the selected file/bookmark, but do not jump to the 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 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 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 to file equivalent to Nerdtree-i, to the directory equivalent to Nerdtree-e d delete current bookmark p jump to root node p jump to parent node K jump to the first node of sibling under current directory J jumps to the last node of the sibling in the current directory K jumps to the previous node of the 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 the parent directory of the current root node as the root and becomes the closing root node. u the parent directory of the current root node 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. Span class= "Hljs-keyword" >CD set CWD to selected directory I toggle whether to show hidden files F Toggle whether file filter F toggles whether display file B toggle Show bookmarks Q close nerdtree window? Toggle Show Quick help          

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)

* 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
 

The NERD Tree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.