Talk vim together (17th: Cscope of Vim plugin)

Source: Internet
Author: User


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 talk about Vim's plugin. This time we want to say the vim plugin called: Cscope. Well, that's the word, the gossip,

Words return to the positive turn. Let's talk about vim together!


Crossing, we are talking about the plugin in vim: Cscope. Cscope is a tool, or an application software, and Ctags

Similar, but it's more powerful than ctags, but it's not a ctags upgrade, because it has some ctags features.

It can also run in Vim in the form of plugins, which is the same as ctags. Cscope can put the file name, function in the source code

Names, variable names are collected together, and a database is generated. By importing this database into Vim, we can easily find files,

Functions and variables, even call relationships between functions can be found. The database file generated by Cscope can also be likened to a map. No

This map is much more accurate than the map generated by ctags because it can locate something that ctags cannot locate.

such as file names and variable names.


Crossing, we use the mint in the default does not install Cscope, so we need to manually install. The installation method is as follows:

    • 1. Check the Cscope:

First use the command: which cscope to confirm that Cscope is installed in the system, and after the command is executed, there is no

Results, which indicates that Cscope is not installed in the system.


    • 2. Install Cscope:

Use the command: Apt-get install cscope to mount the Cscope, after executing the command (use root

Account to execute the command) and get the following result:

Reading Package List ... Complete

Analyzing Dependency tree for Package

Reading status information ... Complete

Recommended Packages to install:

Cscope-el

The following "new" packages will be installed:

Cscope

0 packages were upgraded, 1 new packages were installed, 0 packages were uninstalled, 388 packages were not upgraded.

You need to download the 143 KB package.

756 KB of extra space is consumed after decompression.

Get: 1 http://archive.ubuntu.com/ubuntu/trusty/universe cscope i386 15.8a-2 [143 KB]

Download 143 KB, time 2 seconds (70.9 kb/s)

Selecting previously unselected package cscope.

(Reading Database ... The system currently has a total of 158,092 files and directories installed. )

Preparing to unpack .../cscope_15.8a-2_i386.deb ...

Unpacking Cscope (15.8a-2) ...

Processing triggers for man-db (2.6.7.1-1UBUNTU1) ...

Setting Cscope (15.8a-2) ...


    • 3. Confirm Cscope:

Finally, we confirm that the installation was successful, and confirm that the method is the same as in step 1: which Cscope,

After executing the command, the following results are obtained:/usr/bin/cscope. This indicates that the Cscope has been successfully installed in the system.


Crossing, as we said in the previous reply, when you use the source code of a vim+ctags reader, you can quickly navigate to where the function is defined,

Save us the time to find the function, and thus improve the efficiency of the source code of the Reading program. If the cscope is added to the Vim plug-in, it is also

Is Vim+ctags+cscope. Then the function of Vim is further expanded, it can not only quickly locate the function, but also can

To quickly locate files and variables, even call relationships for functions can be located. Crossing, do you feel your hands are itching to hear?

So hurry up and try it yourself. Like Grandpa Mao said: Do it yourself, clothed.


You crossing, about the Vim plugin: Cscope, 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 (17th: Cscope of Vim plugin)

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.