diff --git a/.ksh/aliases.ksh b/.ksh/aliases.ksh index 4b846ea..7a11464 100644 --- a/.ksh/aliases.ksh +++ b/.ksh/aliases.ksh @@ -17,6 +17,15 @@ alias exrc="vim ~/.exrc" alias trans-en="trans -l de -s en -t de --no-ansi" alias trans-de="trans -l en -s de -t en --no-ansi" +# taskwarrior +alias t=task +alias t-all="task rc.context:" +alias ta="task add" +alias ta-work="task rc.context:work" +alias ta-home="task rc.context:home" +alias ta-uugrn="task rc.context:uugrn" +alias ta-openbsd="task rc.context:openbsd" + # gopher bookmarks alias fefe="sacc gopher://codevoid.de/1/fefe" alias hn="sacc gopher://codevoid.de/1/hn" diff --git a/.vim/vimrc b/.vim/vimrc index 27e9580..5b5f54c 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -104,11 +104,17 @@ set tags=./tags;/ "nnoremap gs :cs find 4 =expand("") nnoremap gb "nnoremap gh :FSHere +nnoremap gs :call Cscope('0', expand(''), 0) +nnoremap gc :call Cscope('3', expand(''), 0) +nnoremap ge :call Cscope('6', expand(''), 0) + let g:fzf_tags_prompt = "Gd " noreabbrev ts getcmdtype() == ":" && getcmdline() == 'ts' ? 'FZFTselect' : 'ts' nmap gt (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 (EasyAlign) nmap ga (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