Cscope Installation and Configuration

Source: Internet
Author: User
Tags egrep

1. Introduction

Cscope is a ctags-like tool, but can be thought of as an enhanced version of Ctags.

2. Installation
    • sudo apt-get install Cscope
    • Install by source, refer to http://blog.csdn.net/hpwzd/article/details/7405401
3. Configuration
  • In the directory where the source code is located, executing CSCOPE-RBKQ will generate three files: cscope.out/csope.in.out/cscope.po.out
  • Add the following paragraph in the VIMRC, where/usr/bin/cscope is the directory where the executable file is located and can be viewed through Whereis:
  • 1 "...... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... cscope ..... ..... ..... ... .. .....2 ifHas ("Cscope")3Set csprg=/usr/bin/Cscope4Set csto=05 set CST6 Set Nocsverb7     "Add any database in current directory8     ifFilereadable ("Cscope.out")9 CS Add cscope.outTen     "Else Add database pointed to by environment OneElseIf $CSCOPE _db!="" A CS Add $CSCOPE _db - endif - Set Csverb the endif - "..... cscope Replace- --------.....????????? -Nmap <[email Protected]>s:csFindS <c-r>=expand ("<cword>") <CR><CR> -Nmap <[email Protected]>g:csFindG <c-r>=expand ("<cword>") <CR><CR> +Nmap <[email Protected]>c:csFindC <c-r>=expand ("<cword>") <CR><CR> -Nmap <[email Protected]>t:csFindT <c-r>=expand ("<cword>") <CR><CR> +Nmap <[email Protected]>e:csFindE <c-r>=expand ("<cword>") <CR><CR> ANmap <[email Protected]>f:csFindF <c-r>=expand ("<cfile>") <CR><CR> atNmap <[email Protected]>i:csFindI <c-r>=expand ("<cfile>") <CR><CR> -Nmap <[email Protected]>d:csFindD <c-r>=expand ("<cword>") <CR><CR>

    To use this method, press [email protected] and release press ' s ':

      • [Email protected]> s----Find the C language symbol, that is, find the function name, macro, enumeration value, etc. where it appears
      • [Email protected]> g----Find the location defined by functions, macros, enumerations, etc., similar to the functions provided by ctags
      • [email protected]> d----Find functions called by this function
      • [email protected]> c----Find functions that call this function
      • [email protected]> t----Find the specified string
      • [email protected]> e----Find egrep mode, equivalent to Egrep function, but the search speed is much faster
      • [email protected]> f----Find and open files, like Vim's find function
      • [Email protected]> i----Find the text containing this document

One thing to note is that opening the source file needs to be opened under the Cscope.out path, such as $ VI/drivers/tty/serial/imx.c instead of executing $ VI imx.cinto the serial directory. Otherwise, the cscope cannot be found.

Cscope Installation and Configuration

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.