From 96128d34cb0cf552cb679be4aa9f1ba9ba5fc629 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 16 Sep 2010 14:49:27 +0200 Subject: [PATCH] [vim]Correct some unused shortcurt : use cscope and folding --- .vimrc | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index 5fb9c45..309b78e 100644 --- a/.vimrc +++ b/.vimrc @@ -5,7 +5,7 @@ " F2 open file " F3 search " F4 open include file -" F5 go to declaration +" F5 find C symbol " F6 go to definition " F7 go to calls " F8 view tag list @@ -228,8 +228,8 @@ set mat=5 " search word and list lines to jump with F3 map [I:let nr = input("Which one: ") execute "normal " . nr ."[\t" " go to declaration with F5 -map gd:nohlsearch -imap i +" map gd:nohlsearch +" imap i " try to go to definition or declaration with , and go back with ; function GoToDefinition() try @@ -288,6 +288,9 @@ if has("cscope") " open include file with F4 and split with shift+F4 nmap :cscope find f =expand("") nmap :scscope find f =expand("") + " find this C symbol with F5 and split with shift+F5 + nmap :cscope find s =expand("") + nmap :scscope find s =expand("") " go to definition with F6 and split with shift+F6 and use ctags with alt+shift+F6 nmap :cscope find g =expand("") nmap :scscope find g =expand("") @@ -323,13 +326,21 @@ if has("cscope") nmap i :vertical scscope find i ^=expand("")$ nmap d :vertical scscope find d =expand("") " s symbol find all references to the token under cursor - " g global find global definition of the token under cursor + " //find this C symbol + " g global find global definition of the token under cursori + " //find this definition " 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 + " //find function calling this function " d called find functions that function under cursor calls + " //find function called by this function + " t text find all instances of the text under cursor + " //find this text string + " e egrep egrep search for the word under cursor + " //find this egrep pattern + " f file open the filename under cursor + " //find this file + " i includes find files that include the filename under cursor + " //find files #including this file endif " cat Makefile | grep '\-I\/' | tr '[:space:]' '\n' | grep '\-I/' | sort -u | tr '\n' ' ' @@ -449,6 +460,26 @@ if has("autocmd") autocmd BufRead,BufNewFile COMMIT_EDITMSG setf git endif +" zf#j creates a fold from the cursor down # lines. +"zf/string creates a fold from the cursor to string . +"zj moves the cursor to the next fold. +"zk moves the cursor to the previous fold. +"zo opens a fold at the cursor. +"zO opens all folds at the cursor. +"zm increases the foldlevel by one. +"zM closes all open folds. +"zr decreases the foldlevel by one. +"zR decreases the foldlevel to zero -- all folds will be open. +"zd deletes the fold at the cursor. +"zE deletes all folds. +"[z move to start of open fold. +"]z move to end of open fold. + +" fold form this bracket +nmap zfa{ +" unfold or use End +nmap zo + """""""""""""""""""""""""""""""""""""""""""""""""" "Omni-completion par CTRL-X_CTRL-O