Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scope vs ctags in terms of features

Tags:

c++

c

vim

ctags

cscope

I am a big fan of ctags Hence I am wondering if I have cscope, will I benefit more there two programs. Seems like the latter has the same features as ctags, namely, facilitating the finding of symbols.

What are the features scope offers that can further increase my productivity with VIM?

Thanks

like image 430
vehomzzz Avatar asked Sep 08 '09 11:09

vehomzzz


People also ask

What are cscope and Ctags?

cscope, ctags, and Vim are powerful tools for reading a lot of code. ctags can be used to take you to the definition of a variable (e.g., a function, variable, or macro). cscope can be used to take you to the call site of a definition (e.g., all function calls, all variable uses, all macro uses).

What is the use of cscope?

cscope is an interactive, screen-oriented tool that allows the user to browse through C source files for specified elements of code.


1 Answers

cscope can certainly improve your productivity.

ctags only allows you to navigate to the declaration of a symbol (one-way lookup).

cscope allows you to:

  • Go to the declaration of a symbol
  • Show a selectable list of all references to a symbol
  • Search for any global definition
  • Functions called by a function
  • Functions calling a function
  • Search for a text string
  • Search for a regular expression pattern
  • Find a file
  • Find all files including a file

Tutorials:

  • Vim/Cscope tutorial
  • Using Vim and cscope within cygwin

Related SO questions:

  • cscope or ctags why choose one over the other?
  • What is a good tool to aid in browsing/following C code?
  • Vim+ctags tips and tricks
like image 179
Tim Henigan Avatar answered Oct 08 '22 09:10

Tim Henigan