Update 2024-01-24 08:27 OpenBSD/amd64-x13
This commit is contained in:
20
.vim/vimrc
20
.vim/vimrc
@@ -104,11 +104,17 @@ set tags=./tags;/
|
||||
"nnoremap gs :cs find 4 <C-R>=expand("<cword>")<CR><CR>
|
||||
nnoremap gb <c-o>
|
||||
"nnoremap gh :FSHere<CR>
|
||||
nnoremap gs :call Cscope('0', expand('<cword>'), 0)<CR>
|
||||
nnoremap gc :call Cscope('3', expand('<cword>'), 0)<CR>
|
||||
nnoremap ge :call Cscope('6', expand('<cword>'), 0)<CR>
|
||||
|
||||
|
||||
let g:fzf_tags_prompt = "Gd "
|
||||
noreabbrev <expr> ts getcmdtype() == ":" && getcmdline() == 'ts' ? 'FZFTselect' : 'ts'
|
||||
nmap gt <Plug>(fzf_tags)
|
||||
|
||||
|
||||
|
||||
let g:autotagTagsFile = ".tags"
|
||||
let g:autotagCtagsCmd = "ectags"
|
||||
|
||||
@@ -133,8 +139,22 @@ silent execute '!mkdir -p ~/.local/vim/backup ~/.local/vim/undo ~/.local/vim/swa
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
|
||||
function! LoadCscope()
|
||||
let db = findfile("cscope.out", ".;")
|
||||
if (!empty(db))
|
||||
let path = strpart(db, 0, match(db, "/cscope.out$"))
|
||||
set nocscopeverbose " suppress 'duplicate connection' error
|
||||
exe "cs add " . db . " " . path
|
||||
set cscopeverbose
|
||||
" else add the database pointed to by environment variable
|
||||
elseif $CSCOPE_DB != ""
|
||||
cs add $CSCOPE_DB
|
||||
endif
|
||||
endfunction
|
||||
|
||||
augroup mystuff
|
||||
au!
|
||||
au BufEnter /* call LoadCscope()
|
||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
au BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
|
||||
au BufRead,BufNewFile Makefile,/usr/src/*.c,/usr/src/*.h,*.gmk setl sw=8 sts=8 noet
|
||||
|
||||
Reference in New Issue
Block a user