Talk vim together (16th: Vim plugin ctags cont.)

Source: Internet
Author: User
Tags function definition


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

This time, let's continue to say the plugin. Or that sentence, gossip Hugh, words return to the positive turn. Let's talk about vim together!


Crossing, we said in the last time how to install VIM plug-in ctags into the system. Some crossing told me that I would not use this plug.

Thing Crossing, we are going to talk about how to use ctags this plugin.


Crossing, the steps to use Ctags are as follows:

    • 1. Generate tags File:

As we said in the previous reply: Ctags is mainly used to generate files with tags tag. Do you remember our metaphor? tags text

Pieces are like maps. Then creating a tags file is making a map. We can use the command: Ctags-r to generate the current directory

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


    • 2. Import Tags file:

I suggest that by modifying the Vim configuration file, Vim will automatically import the tags file when it is launched. How to modify Vim

Configuration file that we have already said in the previous back, look at step 4 in detail.


    • 3. Use the tags file:

Use VIM to open the program file, put the cursor on a function, press CTRL +] to quickly jump to the letter

Where the number is defined, so that we can quickly find the implementation of the function. I am here to add that this

Open the program file, must be in the directory to generate tags, or vim will prompt: Can not find tags information.


Crossing, in general, we use Vim+ctags to read the program's source code, which is very powerful ctags provides

You can quickly locate the function definition, save us the time to find the function, and thus improve the efficiency of the source code of the Reading program.


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

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

Talk vim together (16th: Vim plugin ctags 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.