Quickly Enable cscope in Vim

May 1, 2018

 

 

 This post list a set of steps to quickly start browsing code in vim. Its a short version of http://cscope.sourceforge.net/cscope_vim_tutorial.html

 

1. Install cscope with:

 

2. Make ~/.vim/plugin

 

3. Copy this into a file called ~/.vim/plugin/cscope_maps.vim:

 

4. Run this in your source tree:

The cscope status bar will grow:

 

Until it completes:

 

 

5. Type Control+d to quit.

 

6.  Open a source file. Move the cursor over a symbol and type: Control+\ s.

 

Note

 

A potentially more useful method is to present the result in a split window. With the cursor over the symbol of interest, type Control+spacebar s. Type Control+w arrowkey to enter the window. With the window selected, type Control+w q to close the window.

 

Note 2

 

In addition to s you can use these: 

...from ~/.vim/plugin/cscope_maps.vim

 

7. Type the # of the result. 

 

Example

 

Type 2 to jump to cdns_wdt_probe 

 

8. Type Control+t to get back to where you were, i.e. "popping off the tag stack"

 

 

Reference

GNU image from link

 

Please reload

Our Recent Posts

Columnize a List of Fields Using Excel 2016 on Windows 7

July 6, 2020

Turn On the Developer Tab in Excel 2016 on Windows 7

July 6, 2020

NASA's Aerospace Technology Resources

June 27, 2020

1/1
Please reload

Tags

Please reload

SEARCH THIS SITE

©2018 by Zach Pfeffer