Update 2025-01-01 10:48 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2025-01-01 10:48:50 +01:00
parent 08aaf050a6
commit 767ba27c2b

View File

@ -158,7 +158,7 @@ highlight DiffDelete ctermfg=234 ctermbg=52
highlight DiffChange ctermfg=255 ctermbg=234 highlight DiffChange ctermfg=255 ctermbg=234
highlight DiffText ctermfg=166 ctermbg=234 highlight DiffText ctermfg=166 ctermbg=234
" GITGUTTER " PLUGIN: GITGUTTER
set signcolumn=number set signcolumn=number
highlight GitGutterAddLine ctermfg=1 ctermbg=0 highlight GitGutterAddLine ctermfg=1 ctermbg=0
highlight GitGutterChangeLine ctermfg=3 ctermbg=0 highlight GitGutterChangeLine ctermfg=3 ctermbg=0
@ -201,15 +201,18 @@ nmap <silent> <Down> gj
nmap <silent> <Up> gk nmap <silent> <Up> gk
" NEXT WINDOW " NEXT WINDOW
" clashes a bit in real life with shift+tag (toggle paste mode)
nnoremap <Tab> :wincmd w<cr> nnoremap <Tab> :wincmd w<cr>
" USE ARROW / VIM KEYS INSIDE OMNIBOX " USE ARROW / VIM KEYS INSIDE OMNIBOX
" FIXME: it has been a while that I've use the omnibox...
inoremap <expr> j pumvisible() ? '<C-n>' : 'j' inoremap <expr> j pumvisible() ? '<C-n>' : 'j'
inoremap <expr> k pumvisible() ? '<C-p>' : 'k' inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>' inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>'
inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>' inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>'
" NETRW " NETRW
" because nerdtree is unnecessary
let g:netrw_banner = 0 " disable annoying banner let g:netrw_banner = 0 " disable annoying banner
let g:netrw_browse_split = 4 " open in prior window let g:netrw_browse_split = 4 " open in prior window
let g:netrw_altv = 1 " open splits to the right let g:netrw_altv = 1 " open splits to the right
@ -219,17 +222,24 @@ let g:netrw_keepdir = 0
let g:netrw_winsize = 25 let g:netrw_winsize = 25
hi! link netrwMarkFile Search hi! link netrwMarkFile Search
" TAGS FILE " findtags dir searches for the root of CVS or GIT repositories
" and returns the path for the tag file, and $PWD if neigher
" GIT nor CVS is detected. Tags will go in:
" - gitroot/.git/tags
" - cvsroot/.tags/tags
" - $PWD/.tags/tags
" The same location will be used by cscope.
let tagsdir = trim(system("$HOME/.vim/bin/findtagsdir")) let tagsdir = trim(system("$HOME/.vim/bin/findtagsdir"))
execute "set tags=".tagsdir."/tags" execute "set tags=".tagsdir."/tags"
"set tags=.git/tags;.tags/tags; " Search tagfile backward recursive "set tags=.git/tags;.tags/tags; " Search tagfile backward recursive
nnoremap gt <c-]> " Jump to tag (go tag) nnoremap gt <c-]> " Jump to tag (go tag)
nnoremap gb <c-o> " Jump to last position (go back) nnoremap gb <c-o> " Jump to last position (go back)
nnoremap gh :FSHere<CR> " Jump to header file (go header) nnoremap bg :ls<cr>:b " Jump to buffer number (buffer go)
nnoremap bb :ls<cr>:b nnoremap bb :ls<cr>:b#<cr><cr> " Jump to last open buffer (buffer back)
nnoremap  :Lex<cr> nnoremap  :Lex<cr> " open file browser
" CSCOPE " PLUGIN: CSCOPE
" I can never remember these keys.., or what they do
if has("cscope") if has("cscope")
set csprg=cscope set csprg=cscope
set cst set cst
@ -256,16 +266,16 @@ if has("cscope")
nmap tf :scs find f <C-R>=expand("<cfile>")<CR><CR> nmap tf :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap ti :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> nmap ti :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap td :scs find d <C-R>=expand("<cword>")<CR><CR> nmap td :scs find d <C-R>=expand("<cword>")<CR><CR>
function! UpdateCSCOPE()
:! cscope -RL -f .git/cscope.out
:! ectags -Rf .git/tags
endfunction
endif endif
" CUSTOM: Good idea, but when have I used this last time?
" nmap  :cnext<CR> " nmap  :cnext<CR>
" nmap  :cprevious<CR> " nmap  :cprevious<CR>
nmap  :execute "grep " . expand("<cword>")<CR><CR> nmap  :execute "grep " . expand("<cword>")<CR><CR>
" CUSTOM: Make shortcuts
" this is awful cr cr cr cr cr
" FIXME find a more universal solution to trigger builds
nmap mm :make<CR><CR><CR> nmap mm :make<CR><CR><CR>
nmap mt :make test<CR><CR><CR> nmap mt :make test<CR><CR><CR>
nmap md :make debug<CR><CR><CR> nmap md :make debug<CR><CR><CR>
@ -273,6 +283,7 @@ nmap em :!vim Makefile<CR><CR>
nmap st :!smake . test<CR> nmap st :!smake . test<CR>
nmap sm :!smake . <CR> nmap sm :!smake . <CR>
" CUSTOM: Toggle Paste Mode
let s:enablepaste = 0 let s:enablepaste = 0
function! TogglePasteMode() function! TogglePasteMode()
if s:enablepaste if s:enablepaste
@ -284,12 +295,16 @@ function! TogglePasteMode()
endfunction endfunction
nmap <S-tab> :call TogglePasteMode()<CR> nmap <S-tab> :call TogglePasteMode()<CR>
" FIXME: not really used...?
if executable('ugrep') if executable('ugrep')
set grepprg=ugrep\ -RInk\ -j\ -u\ --tabs=1\ --ignore-files set grepprg=ugrep\ -RInk\ -j\ -u\ --tabs=1\ --ignore-files
set grepformat=%f:%l:%c:%m,%f+%l+%c+%m,%-G%f\\\|%l\\\|%c\\\|%m set grepformat=%f:%l:%c:%m,%f+%l+%c+%m,%-G%f\\\|%l\\\|%c\\\|%m
endif endif
" CUSTOM: # highlights, n searches. " CUSTOM: AUTO BRACKET
inoremap {<cr> {<cr> <cr>}<up><end><c-h>
" CUSTOM: 'h' => highlight word, 'n' => search for it
nmap # :let @/ = expand('<cword>')\|set hlsearch<C-M> nmap # :let @/ = expand('<cword>')\|set hlsearch<C-M>
" CUSTOM: root save " CUSTOM: root save
@ -305,43 +320,39 @@ let g:tagbar_ctags_bin = "ectags"
" PLUGIN: TERMDEBUGGER " PLUGIN: TERMDEBUGGER
let g:termdebugger = "egdb" let g:termdebugger = "egdb"
" PLUGIN: EASY ALIGN """
xmap ga <Plug>(EasyAlign) """ AUTOCOMMANDS
nmap ga <Plug>(EasyAlign) """
augroup CisNotCPP
" CUSTOM: AUTO BRACKET au!
inoremap {<cr> {<cr> <cr>}<up><end><c-h> au BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
" CUSTOM: TREAT C FILES AS C, NOT C++
augroup Programming
autocmd!
autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
augroup END augroup END
" CUSTOM: AUTORELOAD ON VIMRC CHANGE
augroup AutoReloadVimrc augroup AutoReloadVimrc
au! au!
au BufWritePost vimrc so $MYVIMRC au BufWritePost vimrc so $MYVIMRC
augroup END augroup END
augroup myquickfix augroup AutoOpenCloseQFixWindow
autocmd! au!
autocmd QuickFixCmdPost [^l]* cwindow au QuickFixCmdPost [^l]* cwindow
autocmd QuickFixCmdPost l* lwindow au QuickFixCmdPost l* lwindow
augroup END augroup END
augroup CurorPosOnLoad augroup LoadCursorPosition
autocmd BufReadPost * au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") | \ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" | \ exe "normal! g`\"" |
\ endif \ endif
augroup END augroup END
augroup DiffSyntax augroup ResplitOnResize
autocmd! OptionSet diff syntax off au!
au VimResized * wincmd =
augroup END augroup END
augroup AutoSplitResize augroup AutoTabSpace
autocmd! au!
autocmd VimResized * wincmd = au BufRead,BufNewFile Makefile,/usr/src/*.c,/usr/src/*.h,*.gmk setl sw=8 ts=8 noet
augroup END augroup end