©2018 by Zach Pfeffer

SEARCH THIS SITE

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

A Fix for "You don't have permission to create items on this site: https://yoursite.sharepoint.com/sites/pwa"

September 25, 2019

Create a Tree-View of a Directory on Linux with 'tree'

August 17, 2019

Use draw.io in Google Drive (and Get Rid of draw.io )

June 30, 2019

1/1
Please reload

Tags

Please reload