Talk vim together (21st: Vim plugin nerdtree cont.)

Source: Internet
Author: User


Everyone crossing, welcome to listen to the large-scale couplet science fiction: Vim. Last time we introduced the Nerdtree in vim.

Plug - ins.. This time, let's continue to talk about the Nerdtree plugin, but what we said on the previous page is how to install the plugin.

How to use the plugin. Well, still that sentence, gossip Hugh, words return to the positive turn. Let's talk about vim together!


Crossing, let's first talk about the basic operation of Nerdtree. Specific as follows:

    • H J k L these keys operate in the Catalog window in the same way as VIM, which is not explained in detail here.
    • J K represents the top/bottom directory, which is handy when the directory is long.
    • Q means close the Nerdtree window, which is the shortcut key that the plugin customizes.
    • o 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, and I feel it is more deserving than the Enter.
    • P means jumping directly to the directory where the current file is located, which can be understood as the root directory of the current action file.
    • P means jump directly to the root directory.


Crossing, after using Nerdtree for a period of time, you will find some inconvenient places, below put my own method of using it and everyone

Share, after all, everyone's operating habits are not the same, I hope my method can bring you help.

    • 1. On the right side of the window:

Nerdtree opens a new window in the leftmost window by default, and TagList opens a new window by default in the leftmost window, so they collide. So I put the Nerdtree window on the right. "How to put", under the Taiwan crossing asked. Configuration in the VIM configuration file: Let nerdtreewinpos= ' right '. Here is the interface when using both the Nerdtree and taglist windows. In this diagram, the left side is the TagList window, and the right side is the Nerdtree window. The middle is the window that opens a file, which can be viewed as the main window of vim.


    • 2. Beautiful catalogue:

Nerdtree by default using arrows to display the directory hierarchy, I do not like, to change the arrows into the |+ this classic display way. "Or is it a configuration file modification?" Yes, this crossing will answer the answer. Ha ha!!!

Configuration command: Let Nerdtreedirarrows=0

Setting a value of 1 is the default arrow, and setting a value of 0 is the plus sign I like (the arrow is the exact way you can refer to it)

As the saying goes: radish cabbage each their own. Crossing can be set according to their hobbies.


    • 3. Automatically close the directory:

There is no need to keep the Catalog window open for use. I'm used to having to open a file and let it take the directory window from

Shut down.

Configuration method: Let Nerdtreequitonopen=1

For example, use K,J in the Catalog window to move to the cursor to a file called calibrate.c. You can then press the O key and the file will open in the left window. The directory window on the right side is automatically closed.


You crossing, about the Vim plugin: Nerdtree, today, so far. In the back of the chapter, we will also say that other vim

Plug - ins. Do you want to know what plugins are in the future? and listen to tell.

Talk vim together (21st: Vim plugin nerdtree cont.)

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.