summaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2022-02-10 15:27:15 +0100
committerMarc Vertes <mvertes@free.fr>2022-02-10 15:27:15 +0100
commit1e1a1087f799632c021af612eb3c919cf1143237 (patch)
tree51196c52f4dd306221bba942dc37f6a0ffa81007 /.vimrc
parente0b3f54298ebca6e23e631c02764f96f60733f60 (diff)
vim: improve cscope mappings
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc22
1 files changed, 22 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index 8972385..8faef1d 100644
--- a/.vimrc
+++ b/.vimrc
@@ -77,3 +77,25 @@ noremap <leader><leader> :bd<cr>
noremap <leader>o :!open <cWORD>&<cr><cr>
noremap <C-g> :tag <c-r><c-w><cr>
noremap <C-p> :Files<cr>
+
+""""""""""""" My cscope/vim key mappings
+ "
+ " The following maps all invoke one of the following cscope search types:
+ "
+ " 's' symbol: find all references to the token under cursor
+ " 'g' global: find global definition(s) of the token under cursor
+ " 'c' calls: find all calls to the function name under cursor
+ " 't' text: find all instances of the text under cursor
+ " 'e' egrep: egrep search for the word under cursor
+ " 'f' file: open the filename under cursor
+ " 'i' includes: find files that include the filename under cursor
+ " 'd' called: find functions that function under cursor calls
+
+noremap <leader>s :cs find s <C-R>=expand("<cword>")<CR><CR><tab>
+noremap <leader>g :cs find g <C-R>=expand("<cword>")<CR><CR><tab>
+noremap <leader>c :cs find c <C-R>=expand("<cword>")<CR><CR><tab>
+noremap <leader>t :cs find t <C-R>=expand("<cword>")<CR><CR><tab>
+noremap <leader>e :cs find e <C-R>=expand("<cword>")<CR><CR><tab>
+noremap <leader>i :cs find i <C-R>=expand("<cfile>")<CR><CR><tab>
+noremap <leader>f :cs find f <C-R>=expand("<cfile>")<CR><CR><tab>
+noremap <leader>d :cs find d <C-R>=expand("<cword>")<CR><CR><tab>