NERD Tree Directory plugin • Introduction to Plugins
NERD Tree is a vim TreeView File Explorer plugin. NERD tree allows you to navigate through your file system in vim and open the desired file or directory.
• Plug-in installation
? Download Nerd tree,:http://www.vim.org/scripts/script.php?script_id=1658;
? Storage Path , under the Windows system path is:vim installation path \vimxx\, the installation path under the Linux system is:/usr/share/vim/vimxx/;
? Unzip the downloaded unpacking package, overwriting the doc, Nerdtree_plugin, plugin, and syntax directories in the package to the storage path .
• Plugin Commands
"Command mode"
• : Nerdtree : Opens a new directory tree. can provide a path parameter, the command opens a directory tree with that path as the root directory. If no path parameter is provided, the current directory will be the root of the new directory tree.
• : Nerdtreetoggle : If the current tag already exists in the directory tree, the command will refresh the directory tree display, and if the current label does not exist in the directory tree, the effect of the command is the same as: Nerdtree command.
• : Nerdtreeclose : Closes the directory tree for the current tab.
To make it easier to open the directory tree and close the directory tree, we will F2 bind the shortcut key and map it to : Nerdtreetoggle command:
"Bind F2 to Nerdtreetoggle
Map <F2> : Nerdtreetoggle <CR>
So every time we press F2, we can easily switch the directory tree:
• Plug-in shortcut keys
"Normal Mode"
? File node mapping (mappings)
• left-click or enter or o : Opens the specified file.
Go : Opens the specified file, leaving the cursor in the directory tree.
• t : Opens the file in a new tab.
• T : Opens the file in a new tab, leaving the mouse focus on the current tab.
• The middle mouse button or I : Opens the specified file in a horizontal split-screen window.
gi : Opens the specified file in the horizontal Split-screen window, leaving the cursor in the directory tree.
• S : Opens the specified file in a vertical split-screen window.
GS : Opens the specified file in a vertical split-screen window, leaving the cursor in the directory tree.
? Directory node mapping (directory nodes mappings)
• Left-click or enter or o : Opens the specified directory.
• O : Opens the specified directory recursively.
• X : Closes the parent node of the current node.
• X : Recursively closes all child nodes of the current node.
• middle mouse button or e : Browse to the specified directory.
? Bookmark table mappings (Bookmark tables mappings)
• left-click or enter or o : Opens the specified bookmark.
• t : Opens the bookmark in the New tab.
• T : Open the bookmark in the new tab, leaving the mouse focus on the current tab.
• D : Deletes the specified bookmark.
? Tree navigation Map (navigation mappings)
P : jumps to the root node.
• P : Jumps to the parent node of the current node.
• K : Jumps to the first child node of the current directory.
• J : Jumps to the last child node of the current directory.
Ctrl + K : Jumps to the previous sibling node of the current node.
Ctrl + J : Jumps to the next sibling node of the current node.
File System mappings (Filesystem mappings)
• C : Make the currently selected directory the root node of the tree directory, that is, switch the current root node to the selected directory node.
• U : Moves the tree root node in the current view up one level, taking the parent directory of the current root directory as the new root directory.
• U : Move the tree root node in the current view up one level, taking the parent directory of the current root directory as the new root directory, and keeping the original tree directory state intact.
• R : Refreshes the current directory recursively.
• R : Refreshes the current node recursively.
• M : Displays the menu.
• CD : Switches CWD to the directory of the current selection node.
? Tree filter mapping (trees filtering mappings)
• I : Whether to show hidden file switches.
F : Whether the file filter switch is enabled.
f : Whether to display the file switch.
• B : Whether to display the Bookmarks table switch.
Tree Filter map (filtering mappings)
Q : Closes the tree-tree window.
• A : Scale The tree-tree window.
•? : Displays a switch for the help document.
Vim Tree-shaped catalogue