bash hooks + vim clean up

This commit is contained in:
2026-05-06 11:14:48 +02:00
parent e57f0d73a7
commit 478053d6be
12 changed files with 64 additions and 66 deletions
+1
View File
@@ -1 +1,2 @@
#!/bin/env bash #!/bin/env bash
[[ -f "/dev/shm/bash/$BASHPID/oncd" ]] && source "/dev/shm/bash/$BASHPID/oncd"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/env bash
[[ -f "/dev/shm/bash/$BASHPID/onexit" ]] && source "/dev/shm/bash/$BASHPID/onexit"
rm -rf /dev/shm/bash/$BASHPID
+4
View File
@@ -0,0 +1,4 @@
#! /bin/env bash
if [[ -x /usr/bin/neofetch ]]; then
neofetch
fi
+1
View File
@@ -1,2 +1,3 @@
#!/bin/env bash #!/bin/env bash
[[ -f "/dev/shm/bash/$BASHPID/onprompt" ]] && source "/dev/shm/bash/$BASHPID/onprompt"
history -a history -a
-2
View File
@@ -10,5 +10,3 @@ shopt -s globstar 2>/dev/null || true # Recursive globbing
# Auto-correct # Auto-correct
shopt -s cdspell shopt -s cdspell
shopt -s dirspell 2>/dev/null || true shopt -s dirspell 2>/dev/null || true
[[ -x /usr/bin/neofetch ]] && neofetch
+1 -1
View File
@@ -5,6 +5,6 @@ export HISTCONTROL="ignoreboth:erasedups"
shopt -s histappend cmdhist shopt -s histappend cmdhist
export HISTFILESIZE=10000 export HISTFILESIZE=10000
export HISTSIZE="$HISTFILESIZE" export HISTSIZE="$HISTFILESIZE"
export HISTIGNORE="?? :but:but rub *:but commit:but ?? ?? :tree:vim:git info:git i:git lazy:git l" export HISTIGNORE="?? :but:but rub *:but commit:but ?? ?? :tree:vim:git:git info:git i:git lazy:git l"
bind '"\C-@": "\e^I history | grep '\''\e\e^A'\''\e\ei"' bind '"\C-@": "\e^I history | grep '\''\e\e^A'\''\e\ei"'
+4
View File
@@ -39,3 +39,7 @@ Development tool configurations including aliases and environment managers.
- Contains development tools and shortcuts - Contains development tools and shortcuts
- Environment managers handle Java, Node.js, PHP, Gradle versions - Environment managers handle Java, Node.js, PHP, Gradle versions
- Automatically sourced by main `.bashrc` - Automatically sourced by main `.bashrc`
## Todo
- special behaviour inside dolphin? ([`if [[ $(ps -o comm= -p $PPID) == dolphin ]]; then …`](https://unix.stackexchange.com/a/775802))
+1 -2
View File
@@ -1,5 +1,4 @@
# vim: filetype=bash export OLDPWD="/home/jaandrle/Vzdálené/GitHub/facilitator-network-cell"
export OLDPWD="/home/jaandrle/Dokumenty/Projekty/CommaFeedPodcasts"
export mwdcp='/home/jaandrle/Vzdálené/GitHub/dcp-fe-container-certifedpassport' export mwdcp='/home/jaandrle/Vzdálené/GitHub/dcp-fe-container-certifedpassport'
export mdde='/home/jaandrle/Vzdálené/GitHub/deka-dom-el' export mdde='/home/jaandrle/Vzdálené/GitHub/deka-dom-el'
export mwdgf='/home/jaandrle/Vzdálené/GitHub/DGF-Certified-Supervisory-Academy' export mwdgf='/home/jaandrle/Vzdálené/GitHub/DGF-Certified-Supervisory-Academy'
+8 -8
View File
@@ -21,8 +21,8 @@
"exec": "yes", "exec": "yes",
"description": "AI Browser", "description": "AI Browser",
"glare": "AppImage", "glare": "AppImage",
"last_update": "2026-04-15T14:22:20Z", "last_update": "2026-04-18T21:36:57Z",
"version": "v7.2.0", "version": "v7.2.6",
"downloads": "/home/jaandrle/.local/bin/pinokio" "downloads": "/home/jaandrle/.local/bin/pinokio"
}, },
{ {
@@ -111,9 +111,9 @@
"group": "nondev", "group": "nondev",
"file_name": "fedistar.appimage", "file_name": "fedistar.appimage",
"exec": "yes", "exec": "yes",
"last_update": "2026-03-16T00:48:08Z", "last_update": "2026-04-29T05:16:21Z",
"downloads": "/home/jaandrle/.local/bin/fedistar.appimage", "downloads": "/home/jaandrle/.local/bin/fedistar.appimage",
"version": "v1.12.8", "version": "v1.13.0",
"glare": ".*amd64.*.AppImage" "glare": ".*amd64.*.AppImage"
}, },
{ {
@@ -136,9 +136,9 @@
"file_name": "vim", "file_name": "vim",
"exec": "yes", "exec": "yes",
"downloads": "/home/jaandrle/.local/bin/vim", "downloads": "/home/jaandrle/.local/bin/vim",
"version": "v9.2.0360", "version": "v9.2.0413",
"glare": "GVim.*x86_64.*.AppImage", "glare": "GVim.*x86_64.*.AppImage",
"last_update": "2026-04-17T02:20:55Z" "last_update": "2026-04-29T02:46:09Z"
}, },
{ {
"repository": "viarotel-org/escrcpy", "repository": "viarotel-org/escrcpy",
@@ -147,9 +147,9 @@
"group": "dev", "group": "dev",
"file_name": "escrcpy.appimage", "file_name": "escrcpy.appimage",
"exec": "yes", "exec": "yes",
"last_update": "2026-04-07T11:27:21Z", "last_update": "2026-04-24T10:29:24Z",
"downloads": "/home/jaandrle/.local/bin/escrcpy.appimage", "downloads": "/home/jaandrle/.local/bin/escrcpy.appimage",
"version": "v2.8.1", "version": "v2.9.0",
"glare": ".*x86_64.*.AppImage" "glare": ".*x86_64.*.AppImage"
}, },
{ {
+1 -2
View File
@@ -73,8 +73,7 @@ set keytranslatemap {"ě":";",";":":"}
bindurl ^https://mail.centrum.cz/* ;; composite hint_focus ; js document.activeElement.dispatchEvent(new CustomEvent("mouseover")) bindurl ^https://mail.centrum.cz/* ;; composite hint_focus ; js document.activeElement.dispatchEvent(new CustomEvent("mouseover"))
bind --mode=normal ;gt hint -c [tabindex] bind --mode=normal ;gt hint -c [tabindex]
bind š tab # bind ž fillcmdline tab
bind sš fillcmdline tab
" b→t→n to make more consistent with gn* " b→t→n to make more consistent with gn*
unbind --mode=normal b unbind --mode=normal b
+1 -1
View File
@@ -3,7 +3,7 @@ AntiAliasFonts=true
BoldIntense=true BoldIntense=true
ColorScheme=DarkPastels ColorScheme=DarkPastels
DimmValue=54 DimmValue=54
Font=BlexMono Nerd Font Mono Medium,8,-1,5,500,0,0,0,0,0,0,0,0,0,0,1,Regular Font=BlexMono Nerd Font Mono,8,-1,5,500,0,0,0,0,0,0,0,0,0,0,1,Medium
UseFontLineChararacters=true UseFontLineChararacters=true
[General] [General]
+39 -50
View File
@@ -1,4 +1,4 @@
""" VIM config file | Jan Andrle | 2026-03-05 (VIM >=9.2 AppImage) """ VIM config file | Jan Andrle | 2026-05-05 (VIM >=9.2 AppImage)
"" #region B Base "" #region B Base
scriptencoding utf-8 | set encoding=utf-8 scriptencoding utf-8 | set encoding=utf-8
set pythonthreedll=/lib/x86_64-linux-gnu/libpython3.12.so.1.0 set pythonthreedll=/lib/x86_64-linux-gnu/libpython3.12.so.1.0
@@ -12,15 +12,9 @@
packadd! cfilter packadd! cfilter
let g:ft_man_folding_enable = 1 let g:ft_man_folding_enable = 1
runtime! ftplugin/man.vim runtime! ftplugin/man.vim
" set hidden
execute 'source' fnameescape(s:root . '/rc-cat.vim') execute 'source' fnameescape(s:root . '/rc-cat.vim')
cabbrev <expr> %PWD% execute('pwd')
cabbrev <expr> %CD% fnameescape(expand('%:p:h'))
cabbrev <expr> %CS% mini_enhancement#selectedText()
cabbrev <expr> %CW% echo '<c-r><c-w>'
let mapleader = "\\" let mapleader = "\\"
" better for my keyboard, but maybe use `:help keymap`? " better for my keyboard, but maybe use `:help keymap`?
nnoremap § @ nnoremap § @
@@ -29,22 +23,27 @@
nnoremap ; : nnoremap ; :
nnoremap <leader>u U nnoremap <leader>u U
nnoremap U <c-r> nnoremap U <c-r>
nnoremap ž <c-]>
nnoremap <c-up> <c-y>
nnoremap <c-down> <c-e>
" <c-bs> " <c-bs>
imap  <c-w> imap  <c-w>
cmap  <c-w> cmap  <c-w>
" use tab/s-tab for tabnex/tabNext " use tab/s-tab for tabnex/tabNext
nnoremap <silent><tab> :tabnext<cr> nnoremap <silent>]t :tabnext<cr>
nnoremap <silent><s-tab> :tabprevious<cr> nnoremap <silent>[t :tabprevious<cr>
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" history checkpoints
for key in ['<C-u>', '<C-w>', '<CR>', '.']
execute printf('inoremap %s <C-g>u%s', key, key)
endfor
set diffopt+=algorithm:patience,inline:word,linematch:60 set diffopt+=algorithm:patience,inline:word,linematch:60
augroup vimrc_help augroup vimrc_help
autocmd! autocmd!
autocmd BufEnter *.txt if &buftype == 'help' | wincmd L | vertical resize 90 | endif autocmd BufEnter *.txt if &buftype == 'help' | wincmd L | vertical resize 90 | endif
augroup END augroup END
if has('langmap') && exists('+langremap') && &langremap
set nolangremap
endif
""" #region BB Build-in plugins """ #region BB Build-in plugins
" https://github.com/rbtnn/vim-gloaded/blob/master/plugin/gloaded.vim " https://github.com/rbtnn/vim-gloaded/blob/master/plugin/gloaded.vim
let g:loaded_vimballPlugin = 1 " :h pi_vimball … for plugin creators let g:loaded_vimballPlugin = 1 " :h pi_vimball … for plugin creators
@@ -52,9 +51,6 @@
""" #endregion BB """ #endregion BB
"" #endregion B "" #endregion B
"" #region H Helpers "" #region H Helpers
command! -nargs=0
\ ALTredrawSyntax edit | exec 'normal `"' | exec 'set ft='.&ft
let g:quickfix_len= 0 let g:quickfix_len= 0
function! QuickFixStatus() abort function! QuickFixStatus() abort
hi! link User1 StatusLine hi! link User1 StatusLine
@@ -81,7 +77,7 @@
cabbrev wbw w<bar>bw cabbrev wbw w<bar>bw
set sessionoptions-=options set sessionoptions-=options " causes more problems than it solves
function! NumberOfBuffers() function! NumberOfBuffers()
return len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) return len(filter(range(1, bufnr('$')), 'buflisted(v:val)'))
@@ -90,23 +86,26 @@
set statusline+=··≡·%{QuickFixStatus()}%*··»·%{user_tips#current()}%*··%= set statusline+=··≡·%{QuickFixStatus()}%*··»·%{user_tips#current()}%*··%=
set statusline+=(%{NumberOfBuffers()})··%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype} set statusline+=(%{NumberOfBuffers()})··%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype}
set statusline+=·· set statusline+=··
" set statusline+=··∷·%{mini_sessions#name('')}·· 
set history=500 " How many lines of (cmd) history has to remember set history=500 " How many lines of (cmd) history has to remember
set nobackup nowritebackup noswapfile " …there is issue #649 (for servers) and Im using git/system backups set nobackup nowritebackup noswapfile " …there is issue #649 (for servers) and Im using git/system backups
try try
execute 'set undodir=' . fnameescape(s:root . '/undodir') . ' undofile' | catch | endtry execute 'set undodir=' . fnameescape(s:root . '/undodir') . ' undofile' | catch | endtry
command! HELPundoClear echo 'undolevel='.&undolevels command! HELPundoClear echo 'undolevel='.&undolevels
"" #endregion SLH "" #endregion SLH
"" #region LLW Left Column + Line + Wrap + Scrolling "" #region LLW Left Column + Line + Wrap + Scrolling
set signcolumn=yes set signcolumn=yes
set cursorline cursorcolumn " Always show current position set cursorline cursorcolumn " Always show current position
set number foldcolumn=2 " enable line numbers and add a bit extra margin to the left set number foldcolumn=2 " enable line numbers and add a bit extra margin to the left
set textwidth=120 colorcolumn=81,+1 set textwidth=120 colorcolumn=81,+1
command! HELPtextwidth echo "textwidth=".&textwidth." colorcolumn=".&colorcolumn command! HELPtextwidth echo "textwidth=".&textwidth." colorcolumn=".&colorcolumn
set nowrap " Don't wrap long lines by default set nowrap " Don't wrap long lines by default
set breakindent breakindentopt=shift:2 showbreak= set breakindent breakindentopt=shift:2 showbreak=
set scrolloff=5 sidescrolloff=10 " offset for lines/columns when scrolling set scrolloff=5 sidescrolloff=10 sidescroll=1 " offset for lines/columns when scrolling
set display+=lastline
if has('patch-7.4.2109')
set display+=truncate
endif
"" #endregion LLW "" #endregion LLW
"" #region CN Clipboard + Navigation throught Buffers + Windows + … (CtrlP) "" #region CN Clipboard + Navigation throught Buffers + Windows + … (CtrlP)
set pastetoggle=<F2> | nnoremap <F2> :set invpaste paste?<CR> set pastetoggle=<F2> | nnoremap <F2> :set invpaste paste?<CR>
@@ -128,12 +127,8 @@
endfunction endfunction
nnoremap <silent> <leader>" :call JaaCopyRegister()<cr> nnoremap <silent> <leader>" :call JaaCopyRegister()<cr>
" CtrlP previously nmap ž :CocList buffers<cr> | :syntax on<cr>
nmap <expr> š buffer_number("#")==-1 ? ":CocList --normal buffers\<cr>" : "\<c-^>" nmap <leader>ž :buffers<cr>:buffer
nmap ě :CocList
nmap <leader>3 :buffers<cr>:b<space>
nmap <leader>š :CocList buffers<cr> | :syntax on<cr>
nmap č <leader>š
"" #endregion CN "" #endregion CN
"" #region FOS File(s) + Openning + Saving "" #region FOS File(s) + Openning + Saving
set autowrite autoread | autocmd FocusGained,BufEnter *.* checktime set autowrite autoread | autocmd FocusGained,BufEnter *.* checktime
@@ -176,10 +171,10 @@
command! Explore call Explore() command! Explore call Explore()
nmap <silent> <leader>e :Explore<cr> nmap <silent> <leader>e :Explore<cr>
nnoremap gx :silent exec "!xdg-open '".shellescape(substitute(expand('<cfile>'), '?', '\\?', ''), 1)."'" \| redraw!<cr> nnoremap gx :silent exec "!xdg-open '".shellescape(substitute(expand('<cfile>'), '?', '\\?', ''), 1)."'" \| redraw!<cr>
vnoremap gx :silent exec "!xdg-open '".shellescape(substitute(mini_enhancement#selectedText(), '?', '\\?', ''), 1)."'" \| redraw!<cr> vnoremap gx :silent exec "!xdg-open '".shellescape(substitute('<c-r>*', '?', '\\?', ''), 1)."'" \| redraw!<cr>
"" #endregion FOS "" #endregion FOS
"" #region EN Editor navigation + search "" #region EN Editor navigation + search
set grepprg=LC_ALL=C\ grep\ -HRIns set grepprg=LC_ALL=C\ grep\ -HRIns\ $*\ /dev/null
set hlsearch incsearch " highlight search, start when typing set hlsearch incsearch " highlight search, start when typing
if maparg('<C-L>', 'n') ==# '' if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif " TODO? <bar>syntax sync fromstart nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif " TODO? <bar>syntax sync fromstart
@@ -189,6 +184,15 @@
nmap <Leader>m <Plug>ToggleMarkbar nmap <Leader>m <Plug>ToggleMarkbar
"" #endregion EN "" #endregion EN
"" #region EA Editing adjustment + Syntax + White chars + Folds "" #region EA Editing adjustment + Syntax + White chars + Folds
" Correctly highlight $() and other modern affordances in filetype=sh.
if !exists('g:is_posix') && !exists('g:is_bash') && !exists('g:is_kornshell') && !exists('g:is_dash')
let g:is_posix = 1
endif
nnoremap Y y$
for pair in ['<>', '()', '{}', '[]', '""', "''", '``']
execute printf('inoremap %s <C-g>u%s<Left>', pair, pair)
execute printf('cnoremap %s %s<Left>', pair, pair)
endfor
" surround `:echo char2nr(…)` " surround `:echo char2nr(…)`
let g:surround_8222= "„\r”" let g:surround_8222= "„\r”"
let g:surround_8218= "\r" let g:surround_8218= "\r"
@@ -264,7 +268,6 @@
" EDIT HEPERS " EDIT HEPERS
nnoremap <leader>o o<space><bs><esc> nnoremap <leader>o o<space><bs><esc>
nnoremap <leader>O O<space><bs><esc> nnoremap <leader>O O<space><bs><esc>
nnoremap <s-k> a<cr><esc>
for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ] for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ]
execute m.'map <leader>'.l.' "+'.l | endfor | endfor " no noremap ⇐ https://github.com/jasonccox/vim-wayland-clipboard?tab=readme-ov-file#non-recursive-mappings execute m.'map <leader>'.l.' "+'.l | endfor | endfor " no noremap ⇐ https://github.com/jasonccox/vim-wayland-clipboard?tab=readme-ov-file#non-recursive-mappings
command HELPfold echo 'foldmethod='.&foldmethod.' foldlevel='.&foldlevel.' foldnestmax='.&foldnestmax command HELPfold echo 'foldmethod='.&foldmethod.' foldlevel='.&foldlevel.' foldnestmax='.&foldnestmax
@@ -298,17 +301,6 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
\ "settings": {} \ "settings": {}
\ }) \ })
autocmd FileType scss setl iskeyword+=@-@ autocmd FileType scss setl iskeyword+=@-@
function! CustomKeyWord(word)
if(a:word=="gulp_place")
highlight link gulp_place ErrorMsg
syntax match gulp_place "gulp_place"
augroup gulp_place
autocmd!
autocmd BufEnter *.{js,html} syntax match gulp_place "gulp_place"
augroup END
return 0
endif
endfunction
set completeopt=menuone,longest,preview "longest vs ,noinsert,noselect set completeopt=menuone,longest,preview "longest vs ,noinsert,noselect
inoremap <silent><expr> <F1> coc#pum#visible() ? coc#pum#confirm() : coc#refresh() inoremap <silent><expr> <F1> coc#pum#visible() ? coc#pum#confirm() : coc#refresh()
@@ -332,10 +324,10 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
\ : [] \ : []
endfunction endfunction
" navigate diagnostics, use `:CocDiagnostics` to get all diagnostics of current buffer in location list. " navigate diagnostics, use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nnoremap <silent> gh :call <sid>show_documentation(expand("<cword>"))<cr> nnoremap <silent> K :call <sid>show_documentation(expand("<cword>"))<cr>
vnoremap <silent> gh :<c-u>call <sid>show_documentation(mini_enhancement#selectedText())<cr> vnoremap <silent> K :<c-u>call <sid>show_documentation('<c-r>*"')<cr>
nnoremap <leader>gf :CocList --normal --input='<c-r>=expand("<cword>")<cr>' g nnoremap <leader>gf :CocList --normal --input='<c-r>=expand("<cword>")<cr>' g
vnoremap <leader>gf :<c-u>CocList --normal --input='<c-r>=mini_enhancement#selectedText()<cr>' g vnoremap <leader>gf :<c-u>CocList --normal --input='<c-r>*' g
""" #region COCP Coc popups scroll (Remap <C-f> and <C-b> for scroll float windows/popups.) """ #region COCP Coc popups scroll (Remap <C-f> and <C-b> for scroll float windows/popups.)
if has('nvim-0.4.0') || has('patch-8.2.0750') if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>" nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
@@ -364,9 +356,6 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
command! CLhelpCocAction call feedkeys(':<c-u>help CocAction('' ', 'tn') command! CLhelpCocAction call feedkeys(':<c-u>help CocAction('' ', 'tn')
command! CLrepeatLastChange call feedkeys('/\V<C-r>"<CR>cgn<C-a><Esc>', 'tn') command! CLrepeatLastChange call feedkeys('/\V<C-r>"<CR>cgn<C-a><Esc>', 'tn')
command! -nargs=?
\ CLcheat call cheat_copilot#open(<q-args>==''?&filetype:<q-args>)
function! s:show_documentation(word) function! s:show_documentation(word)
if (!CocAction('hasProvider', 'hover')) if (!CocAction('hasProvider', 'hover'))
if &filetype=='man' | call dist#man#PreGetPage(0) | return 0 | endif if &filetype=='man' | call dist#man#PreGetPage(0) | return 0 | endif