2

I use Vim + Cscope for coding in a large repository.

With the integration of cscope in Vim, say to find the definition of variable, i have to type ":cs f g " on vi's command line.

Is there a easy way to map these actions? Like say if i type (Ctrl + g) on a particular variable, it automatically goes to the variable's definitions ? (Ctrl + s) shows the list of occurrences of the symbol under the cursor ?

Sethu
  • 556
  • 1
  • 7
  • 18
  • *emacs* :P. Just kidding, I'm a vim user, although I've never tried to do this before, it would be useful. – jli Nov 16 '11 at 00:04

2 Answers2

3

I think you're looking for something like this:

nnoremap <C-g> :cs f g<enter>

For more information, see :help map-commands.

Randy Morris
  • 39,631
  • 8
  • 69
  • 76
1

Give this a try

nnoremap <C-g> :execute "normal! cs\ f\ g"<cr>
Rook
  • 60,248
  • 49
  • 165
  • 242