summaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc43
1 files changed, 19 insertions, 24 deletions
diff --git a/.vimrc b/.vimrc
index 9a12605..858bc52 100644
--- a/.vimrc
+++ b/.vimrc
@@ -93,28 +93,23 @@ noremap <C-p> :Files<cr>
" '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>
-
-
-function! CloseOnLast()
- let cnt = 0
- for i in range(0, bufnr("$"))
- if buflisted(i)
- let cnt += 1
- endif
- endfor
- if cnt <= 1
- q
- else
- bd
+if has("cscope")
+ set csto=0
+ set cst
+ set nocsverb
+ if filereadable("cscope.out")
+ cs add cscope.out
+ elseif $CSCOPE_DB
+ cs add $CSCOPE_DB
endif
-endfunction
-
-"noremap <leader><leader> :call CloseOnLast()<cr>
+ set csverb
+endif
+
+nmap <leader>cs :cs find s <C-R>=expand("<cword>")<CR><CR>
+nmap <leader>cg :cs find g <C-R>=expand("<cword>")<CR><CR>
+nmap <leader>cc :cs find c <C-R>=expand("<cword>")<CR><CR>
+nmap <leader>ct :cs find t <C-R>=expand("<cword>")<CR><CR>
+nmap <leader>ce :cs find e <C-R>=expand("<cword>")<CR><CR>
+nmap <leader>ci :cs find i <C-R>=expand("<cfile>")<CR><CR>
+nmap <leader>cf :cs find f <C-R>=expand("<cfile>")<CR><CR>
+nmap <leader>cd :cs find d <C-R>=expand("<cword>")<CR><CR>