Talk Vim together (21st back: NerdTree continuation of Vim plug-in), vimnerdtree

Source: Internet
Author: User

Talk Vim together (21st back: NerdTree continuation of Vim plug-in), vimnerdtree


Hello, everyone. You are welcome to join in to hear the story of Zhang huiti: Vim. The last time we introduced the NerdTree in Vim

Plug-in .. In this case, we will continue to talk about the NerdTree plug-in, but the last time we talked about how to install the plug-in, what we said here is

How to use this plug-in. Okay, let's just say that. Let's leave it for now, and let's go. Let's talk Vim together!


Let's talk about the basic operations of NerdTree. The details are as follows:

  • H j k l keys operate in the same directory window as VIM, which is not described here.
  • J k indicates the directory at the top/bottom. When the directory is very long, they are very convenient.
  • Q indicates closing the NerdTree window, which is the shortcut key customized by the plug-in.
  • O indicates to open or close the directory where the cursor is currently located. If the cursor is currently located in a file, open the file directly,
  • This is a frequently used key. I think it should be more effective than the Enter key.
  • P indicates to directly jump to the directory where the current file is located. It can be understood as the root directory of the current operation file.
  • P indicates to directly jump to the root directory.


After using NerdTree for a while, you will find some inconveniences. Next I will discuss how to use it with you.

After all, everyone has different operation habits. I hope my methods can help you.

  • 1. Right side of the window:

By default, NerdTree opens a new window in the leftmost window, while Taglist opens a new window in the leftmost window by default. In this way, they will conflict. So I put the NerdTree window to the right. "How to put it", the audience was asking. In the Vim configuration file, configure: let NERDTreeWinPos = 'right '. The following is the interface when the NerdTree and Taglist windows are used simultaneously. In this figure, the left side is the Taglist window, and the right side is the NerdTree window. In the middle is the window for opening a file, which can be seen as the main window of Vim.


  • 2. Beautiful directories:

By default, NerdTree uses arrows to display directory hierarchies. I don't like them very much. Instead, I changed the arrow to a classic display method like | +. "Is the configuration file still being modified? Yes, this viewer will answer the question. Haha !!!

Configuration command: let NERDTreeDirArrows = 0

When the value is set to 1, it is the default arrow, and when the value is set to 0, it is my favorite plus sign (for details about the Arrow, refer)

As the saying goes: radish cabbage has its own love. You can set the audience based on your hobbies.


  • 3. automatically close the directory:

There is no need to keep the Directory window open during usage. I am used to opening a file and asking it to change the Directory window from

Disable it.

Configuration method: let NERDTreeQuitOnOpen = 1

For example, use k and j in the Directory window to move the cursor to a file named calibrate. c. Press the o key to open the file in the window on the left. The Directory window on the right is closed automatically.


For more information, see the Vim plug-in NerdTree. In the subsequent chapter, we will also talk about other Vim

Plug-ins. What plug-ins will be available in the future? In addition, the next loop is decomposed.

Related Article

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.