Search code examples
vimkey-bindingscscope

Key bindings for a repetitive action in VIM editor


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 ?


Solution

  • I think you're looking for something like this:

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

    For more information, see :help map-commands.