Talk Vim together (16th back: ctags of Vim plug-in), vimctags

Source: Internet
Author: User

Talk Vim together (16th back: ctags of Vim plug-in), vimctags


Hello, everyone. You are welcome to join in to hear the story of Zhang huiti: Vim. We introduced the ctags in the Vim plug-in last time.

In this case, let's continue with the plug-in. Or that sentence. Let's leave it for now. Let's talk Vim together!


We talked about how to install the Vim plug-in ctags to the system in the last time. The reader told me that this plug will not be used.

. We are worried about how to use the ctags plug-in.


The procedure for using ctags is as follows:

  • 1. Generate the tags file:

As we mentioned in the previous article, ctags are mainly used to generate files with tags. Do you remember our metaphor? Tags text

It is like a map. The generated tags file is used to create a map. Run the command: ctags-R to generate the current directory.

The tags file of all files under (including subdirectories. The default generated tags file is tags (note that there is no suffix ).


  • 2. Import the tags file:

We recommend that you modify the Vim configuration file so that Vim can automatically import the tags file at startup. How to modify Vim

The configuration file has been described in the previous step. For more information, see Step 4 in the previous step.


  • 3. Use the tags file:

Use Vim to open the program file, place the cursor on a function, and press ctrl +] to quickly jump to the function.

In this way, we can quickly find the implementation of this function. I would like to explain here

The program file must be under the directory where the tags is generated. Otherwise, Vim will prompt that the tags information cannot be found.


Normally, we use Vim + ctags to read the source code of the program. ctags provides a powerful function.

You can quickly locate the function definition to save time for searching the function and improve the efficiency of reading the program source code.


For more information, see the Vim plug-in ctags. In later chapters, 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.