[vim]Correct some unused shortcurt : use cscope and folding

This commit is contained in:
Mathieu Maret 2010-09-16 14:49:27 +02:00
parent 34f50c8625
commit 96128d34cb

47
.vimrc
View File

@ -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 <F3> [I:let nr = input("Which one: ") <Bar>execute "normal " . nr ."[\t"<CR>
" go to declaration with F5
map <silent> <F5> gd:nohlsearch<CR>
imap <F5> <ESC><F5>i
" map <silent> <F5> gd:nohlsearch<CR>
" imap <F5> <ESC><F5>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 <F4> :cscope find f <C-R>=expand("<cfile>")<CR><CR>
nmap <S-F4> :scscope find f <C-R>=expand("<cfile>")<CR><CR>
" find this C symbol with F5 and split with shift+F5
nmap <F5> :cscope find s <C-R>=expand("<cfile>")<CR><CR>
nmap <S-F5> :scscope find s <C-R>=expand("<cfile>")<CR><CR>
" go to definition with F6 and split with shift+F6 and use ctags with alt+shift+F6
nmap <F6> :cscope find g <C-R>=expand("<cword>")<CR><CR>
nmap <S-F6> :scscope find g <C-R>=expand("<cword>")<CR><CR>
@ -323,13 +326,21 @@ if has("cscope")
nmap <C-@><C-@>i :vertical scscope find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@><C-@>d :vertical scscope find d <C-R>=expand("<cword>")<CR><CR>
" 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 <F10> zfa{<CR><CR>
" unfold or use End
nmap <S-F10> zo<CR><CR>
""""""""""""""""""""""""""""""""""""""""""""""""""
"Omni-completion par CTRL-X_CTRL-O