Update 2024-09-03 08:48 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2024-09-03 08:48:30 +02:00
parent 06fba5988b
commit 58d177cb68
3 changed files with 267 additions and 179 deletions

View File

@ -8,5 +8,5 @@ fi
mkdir -p "$HOME/ytdl/$1/" mkdir -p "$HOME/ytdl/$1/"
ksh-update-completions & ksh-update-completions &
cd "$HOME/ytdl/$1/" cd "$HOME/ytdl/$1/"
yt-dlp "$2" yt-dlp --cookies-from-browser chromium "$2"

View File

@ -10,9 +10,9 @@
# | WINDOW DECORATION # | WINDOW DECORATION
# +-------------------------------------------------- # +--------------------------------------------------
border_width = 2 border_width = 1
tile_gap = 6 tile_gap = 0
region_padding = 6 region_padding = 0
color_focus = rgb:AF/5F/00 color_focus = rgb:AF/5F/00
color_focus_maximized = rgb:AF/5F/00 color_focus_maximized = rgb:AF/5F/00
@ -20,13 +20,13 @@ color_focus_maximized_free = rgb:AF/5F/00
color_focus_free = rgb:AF/5F/00 color_focus_free = rgb:AF/5F/00
color_unfocus = rgb:44/44/44 color_unfocus = rgb:44/44/44
color_unfocus_free = rgb:55/35/00 color_unfocus_free = rgb:55/35/00
disable_border = 1 disable_border = 0
maximize_hide_bar = 0 maximize_hide_bar = 0
# +-------------------------------------------------- # +--------------------------------------------------
# | BAR SETTINGS # | BAR SETTINGS
# +-------------------------------------------------- # +--------------------------------------------------
bar_enabled = 1 bar_enabled = 0
bar_border_width = 2 bar_border_width = 2
bar_border = rgb:18/18/18 bar_border = rgb:18/18/18

View File

@ -1,181 +1,269 @@
if filereadable("/usr/local/bin/task") " VIM CORE
packadd vim-taskwarrior let &titleold="term"
set nocompatible " enable advanced features
set autochdir " current dir is vim workdir
set title " set xterm title
set path+=.,** " expand to dirs under workdir
set mouse=v " don't interract with the mouse
set laststatus=2 " always show the status line
set keywordprg=":help" " show vim help when hitting "K"
set backspace=indent,eol,start " bkspc behave like expected
set ttimeout " activate timeout for key combos
set ttimeoutlen=50 " set timeout for key combinations
set number " enable line numbers
set numberwidth=6 " space for more numbers
set cursorline " highlight line number+cursor line
if has("bsd")
set cursorlineopt=number
endif
"set cursorcolumn " highlight current cursor column
execute "set colorcolumn=" . join(range(73,80), ',')
set modeline " read vim mode line in files
set modelines=5 " top/bottom line no. to search
set lazyredraw " no scr. update during macros
set spelllang=de,en " spell check languages
syntax enable " enable syntax plugin (builtin)
filetype plugin indent on " load plugins based on filetype
set re=1 " use old regexp engine (faster)
let mapleader = ","
" INDENTATION
set autoindent " indent new lines on same level
set smartindent " smart indent for programming
set cindent " smart indent for C programming
"set formatprg=fmt\ -mnst\ 4\ -w\ 72 " gq wrap rule
set formatprg=par\ -w72qie " gq wrap rule
" SEARCH
"set incsearch " search while typing
set hlsearch " highlight all search matches
"set wrapscan " search continues on top
set ignorecase " search case insensitive
set smartcase " capital letter => case sensitive
" SPACES (TABS)
set tabstop=8 " tabs are displayed as X spaces
set shiftwidth=4 " number of spaces used to indent
let &softtabstop=&shiftwidth " tab key enters X spaces
set expandtab " use spaces when hitting tab
set smarttab " backspace will delete shiftwidth
set textwidth=0 " automatically break lines here
set list " display control characers
set listchars=tab:>- " which characters to display
let g:currentmode={
\ 'n' : 'NORMAL',
\ 'v' : 'VISUAL',
\ 'V' : 'V·Line',
\ '' : 'V·Block',
\ 'i' : 'INSERT',
\ 'R' : 'R',
\ 'Rv' : 'V·Replace',
\ 'c' : 'Command',
\}
" STATUSLINE, AIRLINE/POWERLINE IS FOR NOOBS
set statusline=%#VisualNOS#
set statusline+=\ [%#Visual#%{toupper(g:currentmode[mode()])}%#VisualNOS#]
set statusline+=\ [%#Visual#%f%#VisualNOS#]
set statusline+=%m%r%h%w%q
set statusline+=%=
set statusline+=\ [BUF:%#Visual#%n%#VisualNOS#]
set statusline+=\ [%#Visual#%{&fileencoding?&fileencoding:&encoding}%#VisualNOS#]
set statusline+=\ [%#Visual#%{&fileformat}%#VisualNOS#]
set statusline+=\ [HEX:%#Visual#%B%#VisualNOS#\ INT:%#Visual#%b%#VisualNOS#]
set statusline+=\ [ROW:%#Visual#%l%#VisualNOS#\ COL:%#Visual#%c%#VisualNOS#]
set statusline+=\ [%#Visual#%p%#VisualNOS#%%]
set statusline+=\
" C specific highlighting
let c_space_errors=1 " trailing space and before tab
let c_gnu=1 " GNU gcc specific items
let c_comment_strings=1 " strings and numbers in comment
let c_curly_error=1 " highlight missing } (may be slow)
" TEMPORARY FILES
set undofile " save undo history to disk
set undodir=~/.vim/undo// " save undo history here
set backup " create backups
set backupcopy=yes " copy file and edit original
set backupdir=~/.vim/backup// " save backup files here
set backupskip=mutt-* " do not create backups of emails
set nowritebackup " no extra backup before writing
set writeany " write to any file (:w!)
set directory=~/.vim/swapfiles// " move swapfiles out of the way
" CREATE DIRECTORIES
silent execute '!mkdir -p ~/.vim/undo ~/.vim/backup ~/.vim/swapfiles'
" LOOK N FEEL
set t_Co=256 " for terminal with 256 colors
set background=dark " I prefer dark backgrounds
colorscheme wombat256 " :colorscheme <tab> for more
let g:is_posix = 1 " $( ) is fine
" THEME TWEAKS
highlight CursorLine ctermbg=238
highlight ColorColumn ctermbg=none ctermfg=9
highlight CursorLineNr ctermbg=none ctermfg=208 cterm=none
highlight LineNr ctermbg=233
highlight SpecialKey ctermbg=234 ctermfg=245
highlight Normal ctermbg=234
highlight NonText ctermbg=234 ctermfg=234
highlight ErrorMsg cterm=none
highlight VisualNOS ctermbg=233 ctermfg=238
highlight Visual ctermbg=233 ctermfg=208
highlight Search ctermbg=yellow ctermfg=0
highlight VertSplit ctermbg=none
" HIGHLIGHT SPECIAL WORDS
match ErrorMsg '\(TODO:\|FIXME\|XXX\|workaround\|WTF\|\s\+$\| \+\ze\t\)'
" SPELLING FIX (for cursorline)
highlight SpellBad cterm=NONE ctermfg=darkred ctermbg=NONE
" VIMDIFF COLOR FIX
highlight DiffAdd ctermfg=1 ctermbg=0
highlight DiffDelete ctermfg=2 ctermbg=0
highlight DiffChange ctermfg=3 ctermbg=0
highlight DiffText ctermfg=4 ctermbg=0
highlight VertSplit ctermfg=1 ctermbg=0
" CURSOR SHAPE
" let &t_SI = "\e[6 q" " insert mode: ibeam cursor
" let &t_EI = "\e[2 q" " normal mode: block cursor
" TAB NAVIGATION
set tabpagemax=25 " allowed max tabs (10)
inoremap [5^ <Esc>:tabn<CR> " Strg+PgUp: Next tab
nnoremap [5^ :tabn<CR>
inoremap [6^ <Esc>:tabp<CR> " Strg+PgDown: Previous tab
nnoremap [6^ :tabp<CR>
inoremap  <Esc>:tabnew<CR> " Strg+T: New tab
nnoremap  :tabnew<CR>
" TMUX FIXES
map  <PageDown>
imap  <PageDown>
nmap  <PageDown>
map  <PageUp>
imap  <PageUp>
nmap  <PageUp>
map  <PageDown>
imap  <PageDown>
nmap  <PageDown>
map  <PageUp>
imap  <PageUp>
nmap  <PageUp>
" NAVIGATE ON VISUAL LINES (SOFT WRAP)
imap <silent> <Down> <C-o> gj
imap <silent> <Up> <C-o> gk
nmap <silent> <Down> gj
nmap <silent> <Up> gk
" USE ARROW / VIM KEYS INSIDE OMNIBOX
inoremap <expr> j pumvisible() ? '<C-n>' : 'j'
inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>'
inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>'
" NETRW
let g:netrw_banner = 1 " disable annoying banner
let g:netrw_browse_split = 4 " open in prior window
let g:netrw_altv = 1 " open splits to the right
let g:netrw_liststyle = 0 " tree view
let g:netrw_ctags = "ectags" " ctags executable to use
" TAGS FILE
set tags=./tags;,.git/tags,./.git/tags " Search tagfile backward recursive
nnoremap gt <c-]> " Jump to tag (go tag)
nnoremap gb <c-o> " Jump to last position (go back)
nnoremap gh :FSHere<CR> " Jump to header file (go header)
" CSCOPE
if has("cscope")
set csprg=cscope
set cscopetag
set csto=0
set splitright
if filereadable("cscope.out")
cs add cscope.out
elseif filereadable(".git/cscope.out")
cs add .git/cscope.out
elseif filereadable("/priv/d034266/git/CGK/src/.git/cscope.out")
cs add /priv/d034266/git/CGK/src/.git/cscope.out
endif
" 'ts' symbol: find all references to the token under cursor
" 'tg' global: find global definition(s) of the token under cursor
" 'tc' calls: find all calls to the function name under cursor
" 'tt' text: find all instances of the text under cursor
" 'te' egrep: egrep search for the word under cursor
" 'tf' file: open the filename under cursor
" 'ti' includes: find files that include the filename under cursor
" 'td' called: find functions that function under cursor calls
nmap ts :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap tg :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap tc :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap tt :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap te :scs find e <C-R>=expand("<cword>")<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 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
" ########################################### " PLUGIN: TAGBAR
" # CORE BEHAVIOR nmap <F12> :TagbarToggle<CR>
" ###########################################
set nocompatible
set mouse=
set backspace=indent,eol,start
" ###########################################
" # TEMPORARY FILES
" ###########################################
set undofile
set undodir=~/.local/vim/undo//
set backup
set backupcopy=yes
set backupdir=~/.local/vim/backup//
set directory=~/.local/vim/swapfiles//
silent execute '!mkdir -p ~/.local/vim/backup ~/.local/vim/undo ~/.local/vim/swapfiles'
" ###########################################
" # VISUAL CHANGES
" ###########################################
set shm+=I
set noshowcmd
set noshowmode
syntax on
filetype plugin on
set t_Co=256
set background=dark
colorscheme candle-grey-transparent
hi CursorLineNr ctermbg=NONE ctermfg=30 cterm=NONE
hi CursorLine ctermbg=NONE ctermfg=NONE cterm=NONE
hi SpellBad ctermbg=NONE ctermfg=124
match ErrorMsg '\(TODO:\|FIXME\|XXX\|workaround\|WTF\|: error:.*\|\s\+$\| \+\ze\t\)'
" ###########################################
" # VIMDIFF
" ###########################################
set formatoptions=crolj
hi DiffAdd ctermbg=22 ctermfg=NONE cterm=NONE
hi DiffDelete ctermbg=234 ctermfg=NONE cterm=NONE
hi DiffChange ctermbg=236 ctermfg=NONE cterm=NONE
hi DiffText ctermbg=red ctermfg=NONE cterm=NONE
hi VertSplit ctermbg=NONE ctermfg=246 cterm=NONE
hi FoldColumn ctermbg=NONE ctermfg=251 cterm=NONE
hi Folded ctermbg=233 ctermfg=251 cterm=NONE
hi ErrorMsg ctermbg=NONE ctermfg=160 cterm=NONE
" ###########################################
" # TOGGLES / SETTINGS
" ###########################################
let g:is_posix=1
let g:mapleader = ","
set scrolloff=3
set spelllang=de,en
set hlsearch
set ignorecase
set smartcase
set tabstop=8
set shiftwidth=4
let &softtabstop=&shiftwidth
set expandtab
set smarttab
set textwidth=72
set formatprg=par\ -w72q
set list
set number
set listchars=tab:›,trail:
set fillchars=vert:\|,eob:\
" ###########################################
" # STATUS BAR
" ###########################################
function BufInfo()
endfunction
set laststatus=2
set statusline=%#Comment#
set statusline+=[%{toupper(mode())}]
set statusline+=\ <%n/%{g:bufno}>
set statusline+=%=
set statusline+=\ %f:%l:%c
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}\ %{&fileformat}
set statusline+=\ 0x%B
set statusline+=\ %p%%
" ###########################################
" # OMNI COMPLETE
" ###########################################
set omnifunc=syntaxcomplete#Complete
set wildmenu
set wildmode=longest:full,full
function! CleverTab()
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-N>"
endif
endfunction
inoremap <tab> <C-R>=CleverTab()<CR>
" ###########################################
" # TERMINAL DEBUGGER
" ###########################################
"packadd termdebug
"let g:termdebugger = "egdb"
" ###########################################
" # TAGBAR
" ###########################################
let g:tagbar_ctags_bin = "ectags" let g:tagbar_ctags_bin = "ectags"
noremap <F12> :TagbarToggle<CR>
noremap mm :silent make \| redraw! <CR> " PLUGIN: TERMDEBUGGER
let g:termdebugger = "egdb"
nnoremap <Up> gk " PLUGIN: EASY ALIGN
nnoremap <Down> gj
xnoremap <Up> gk
xnoremap <Down> gj
inoremap <Up> <C-O>gk
inoremap <Down> <C-O>gj
" ###########################################
" # TAGS FILE
" ###########################################
set tags=./tags;/
nnoremap gb <c-o>
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>
" ###########################################
" # CSCOPE
" ###########################################
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
" ###########################################
" # EASY ALIGN
" ###########################################
xmap ga <Plug>(EasyAlign) xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign) nmap ga <Plug>(EasyAlign)
" ########################################### " CUSTOM: AUTO BRACKET
" # AUTORUN inoremap {<CR> {<CR> <CR>}<up><right>
" ###########################################
augroup mystuff " CUSTOM: TREAT C FILES AS C, NOT C++
au! augroup project
au VimResized * wincmd = autocmd!
au BufEnter * let g:bufno=len(getbufinfo({'buflisted':1})) autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
au BufEnter * call LoadCscope() augroup END
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
au BufRead,BufNewFile *.h,*.c set filetype=c.doxygen " CUSTOM: # highlights, n searches.
au BufRead,BufNewFile Makefile,/usr/src/*.c,/usr/src/*.h,*.gmk setl sw=8 sts=8 noet nmap # :let @/ = expand('<cword>')\|set hlsearch<C-M>
au BufWritePost vimrc so ~/.vim/vimrc
augroup end " CUSTOM: AUTORELOAD ON VIMRC CHANGE
augroup myvimrc
au!
au BufWritePost vimrc so $MYVIMRC
augroup END
" CUSTOM: Global Copy
function! Copy()
:w! /tmp/vimcopy.txt
endfunction
nmap  :call Copy()<cr>
" CUSTOM: Global Copy
function! Paste()
:r /tmp/vimcopy.txt
endfunction
nmap  :call Paste()<cr>
" CUSTOM: UPLOAD FILE
function! DoPaste()
:! cat % | ksh -ic "dopaste"
endfunction