Compare commits

5 Commits

Author SHA1 Message Date
386ff7259c git-identity 2025-05-08 12:20:48 +02:00
28f1604b78 updates 2025-05-08 11:07:28 +02:00
04477c25bf 2025-04-25 16:23:44 +02:00
46e9b50a13 (bash) crossSession, m; (git) interactive (+vim) 2025-02-22 14:36:08 +01:00
fff74676d9 vim cleanup 2025-01-07 14:21:11 +01:00
21 changed files with 1663 additions and 3119 deletions

View File

@ -15,8 +15,6 @@ if [ -x /usr/bin/dircolors ]; then
alias diff='diff --color=auto'
fi
~sezení(){ ~/Dokumenty/Projekty/Sezení; }
alias §rm='rm -vi'
alias §cp='cp -vi'
alias §mv='mv -vi'
@ -29,9 +27,42 @@ alias §df='df -Th'
alias §xclip-copy='xclip -selection clipboard'
alias §xclip-paste='xclip -o -selection clipboard'
LAST_PWD_PATH="$BASH_DOTFILES/.bash_last_pwd"
[ -f "$LAST_PWD_PATH" ] && OLDPWD=`cat $LAST_PWD_PATH`
cd(){ builtin cd "$@" && echo `pwd` > "$LAST_PWD_PATH"; }
CROSS_SESSION="$BASH_DOTFILES/.bash_cross_session"
[ -f "$CROSS_SESSION" ] && . "$CROSS_SESSION"
crossSession() {
if [[ '--help' == "${1:---help}" ]]; then
echo 'crossSession [--help]'
echo ' Print this help.'
echo 'crossSession [--list]'
echo ' Lists all cross session variables or print this help.'
echo 'crossSession <name> [<value>]'
echo ' Sets cross session variable <name> to <value> (or empty for unset).'
return 0
fi
if [[ '--list' == "$1" ]]; then
cat "$CROSS_SESSION"
return 0
fi
local name="$1"
local value="$2"
# Check if the variable already exists in the file
if grep -q "^export $name=" "$CROSS_SESSION"; then
if [ -z "$value" ]; then
# If new value is empty, remove the variable from the file
sed -i "/^export $name=/d" "$CROSS_SESSION"
else
# If it exists, replace the old value with the new value
sed -i "s|^export $name=.*|export $name=\"$value\"|" "$CROSS_SESSION"
fi
else
if [ -n "$value" ]; then
# If it doesn't exist and new value is not empty, append the new variable to the file
echo "export $name=\"$value\"" >> "$CROSS_SESSION"
fi
fi
}
cd(){ builtin cd "$@" && crossSession 'OLDPWD' "$(pwd)"; }
history_clean(){ awk '!seen[$0]++ {print $0}' $HOME/.bash_history; }
history_edit(){ vim $HOME/.bash_history; }
@ -49,6 +80,11 @@ history_most_used(){ LC_ALL=C cat ~/.bash_history | cut -d ';' -f 2- | §awk 1 |
alias §less='less -R -S'
m(){
if [[ '-d' == "$1" ]]; then
unset "m$2"
crossSession "m$2"
return 0
fi
if [[ -z "$1" ]]; then
printenv | grep -e '^m'
return 0
@ -56,6 +92,8 @@ m(){
if [[ "--help" == "$1" ]]; then
echo 'm [--help]'
echo ' Lists all marks or print this help.'
echo 'm -d <name>'
echo ' Deletes mark <name>. Unsets variable and cross session variable.'
echo 'm <name> [path]'
echo ' Sets mark <name> to current directory or [path].'
echo ' The mark is just a bash variable, use `$m<name>`.'
@ -64,6 +102,7 @@ m(){
local n="m$1"
[[ -z "${!n}" ]] || return 1
[[ -z "$2" ]] && local p="$(pwd)" || local p="$(readlink -f $2)"
crossSession "$n" "$p"
export $n="$p"
}
alias cd-vifm='cd `vifm --choose-dir -`'
@ -113,13 +152,14 @@ alias §ck-grep='cat /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose | gre
§cmdfu(){ curl "https://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }
aai(){
[[ "$1" == '--help' ]] && ai ask --help && return 0;
echo "ai ask \"$*, thanks for your help\""; ai ask "\"$*, thanks for your help\"";
#echo "ai ask \"$*, thanks for your help\""; ai ask "\"$*, thanks for your help\"";
aipick -m "hi, would like to ask for help: $*\n…please response only with plain text to be used in terminal command without any explanation, thanks for your help";
}
alias npx-wca='npx -y web-component-analyzer'
alias npx-qnm='npx -y qnm'
alias npx-hint='npx -y hint'
alias npx-markdown='nohup npx markserv'
alias npx-markdown='npx -y markserv'
alias fzf=fzf-carroarmato0.fzf
alias smerge='/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=sublime_merge --file-forwarding com.sublimemerge.App @@u %u @@'

View File

@ -8,15 +8,15 @@ source "$SCRIPT_DIR/complete-alias/complete_alias"
complete -F _complete_alias gitdotfiles
alias C--asana='eval "$($HOME/bin/asana.mjs completion_bash)"'
alias C--himalaya='\. "$BASH_DOTFILES/himalaya.completion"'
alias C--brew='\. "$BASH_DOTFILES/brew.completion"'
alias C--pnpm='\. "$BASH_DOTFILES/pnpm.completion"'
alias C--uu='eval "$($HOME/bin/uu --completion-bash)"'
alias C--jc='eval "$(jc -B)" … newer version needed'
eval "$(bs .completion bash)"
\. <(bs .completion bash)
\. "$BASH_DOTFILES/cordova.completion"
eval "$(node --completion-bash)"
eval "$(npm completion)"
eval "$(nodejsscript --completion bash)"
\. "$BASH_DOTFILES/pnpm.completion"
\. <(node --completion-bash)
\. <(npm completion)
\. <(nodejsscript --completion bash)
_npx() {
local cur="${COMP_WORDS[COMP_CWORD]}"

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,8 @@ shopt -s expand_aliases
[ -f $BASH_DOTFILES/.bash_sdkman ] && . $BASH_DOTFILES/.bash_sdkman
[ -f $BASH_DOTFILES/.bash_nvm ] && . $BASH_DOTFILES/.bash_nvm
export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache # https://nolanlawson.com/2024/10/20/why-im-skeptical-of-rewriting-javascript-tools-in-faster-languages/
export PATH="$HOME/.local/bin:$PATH:/home/linuxbrew/.linuxbrew/bin"
export PATH="$HOME/.local/bin:$PATH"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
[ -f $BASH_DOTFILES/.bash_completions ] && . $BASH_DOTFILES/.bash_completions # for Vim
[[ $- != *i* ]] && return # If not running interactively, don't do anything
@ -60,6 +61,8 @@ if ! shopt -oq posix; then
fi
export GPG_TTY=$(tty)
shopt -s cdspell # autocorrects cd misspellings
# HSTR configuration - add this to ~/.bashrc
# if this is interactive shell, then bind hstr to Ctrl-space
# if [[ $- =~ .*i.* ]]; then bind '"\C-@": "\e^ihstr -- \C-j"'; fi

View File

@ -43,7 +43,7 @@ Dockerfile=Dockerfile;dockerfile;*.dockerfile;*.Dockerfile;
#Haxe=*.hx;
#HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;*.tpl;
#Java=*.java;*.jsp;
JavaScript=*.js;*.mjs;
JavaScript=*.js;*.mjs;*.jsx;
#JSON=*.json;
#Julia=*.jl;
#Kotlin=*.kt;*.kts;

View File

@ -1,79 +1,116 @@
# better? defaults
[help]
autocorrect = prompt
[init]
defaultBranch = main
[user]
name = Jan Andrle
email = andrle.jan@centrum.cz
signingkey = B3A25AED155AFFAB
[credential]
# see https://stackoverflow.com/questions/5343068/is-there-a-way-to-cache-https-credentials-for-pushing-commits/18362082#18362082
helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
[alias]
# * replaced by git-extras
aliases = !git config -l | grep ^alias | cut -c 7- | sort # List all aliases. Stolen from here: https://twitter.com/TrevorBramble/status/774292970681937920
checkout-default= !git checkout `git branch-default`
branch-default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
branches = for-each-ref --sort=-committerdate refs --format=\"%(authordate:iso8601)\t%(color:blue)%(refname:short)%(HEAD)\t%(if:notequals="")%(upstream:short)%(then)→ %(upstream:short)%(color:reset)%(else)%(color:yellow)%(objectname:short)%(color:reset)\t%(contents:subject)%(end)\"
tags = tag -l --sort=-creatordate --format='%(refname:short): [%(creatordate:short)] %(subject)'
# * authors: log-authors = shortlog -ns
log-list = log --color --graph --pretty=format:'%Cred%h%Creset %Cgreen[%ad] -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset'
log-list-nocolors = log --graph --pretty=format:'%h [%ad] -%d %s <%an>'
status--= !git fetch && git status && echo && echo Commits unpushed: && git log @{push}..HEAD && echo
commit--interactive-v= !clear && git status -sb | grep -v -e '^ M' & git commit --interactive -v
pu-shll-stash = !git stash && git pull && git push && git stash pop
unstage = reset HEAD --
undoall = reset --soft HEAD^
diff-dirs = diff --dirstat --find-copies --find-renames --histogram --color
submodule-foreach-status = !git submodule --quiet foreach 'git fetch' && git submodule foreach 'git status && echo'
# * delete-submodule: rm-submodule = !git submodule deinit -f $1 && rm -rf .git/modules/$1 && git rm -rf $1
submodule-update-merge = submodule update --remote --merge
set-upstream-to-current = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
push-new=!git push -u origin `git rev-parse --abbrev-ref HEAD`
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[status]
branch = true
short = true
showStash = true
showUntrackedFiles = all
submoduleSummary = true
[log]
date = iso
[fetch]
prune = true
pruneTags = true
[push]
autoSetupRemote = true
followTags = true
recurseSubmodules = on-demand
[pull]
rebase = true
[rerere]
enabled = true
autoupdate = true
[gc]
reflogExpire = 200
reflogExpireUnreachable = 90
[commit]
verbose = true
gpgsign = true
template = ~/.config/git/template
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
# my setup
[core]
editor = vim
pager = delta
whitespace = -trailing-space,-space-before-tab
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[status]
submoduleSummary = true
compression = 9 # trade cpu for network
[alias]
# * replaced by git-extras
# * (alias) aliases = !git config -l | grep ^alias | cut -c 7- | sort # List all aliases. Stolen from here: https://twitter.com/TrevorBramble/status/774292970681937920
branch-default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
# * branches (↓) = for-each-ref --sort=-committerdate refs --format=\"%(authordate:iso8601)\t%(color:blue)%(refname:short)%(HEAD)\t%(if:notequals="")%(upstream:short)%(then)→ %(upstream:short)%(color:reset)%(else)%(color:yellow)%(objectname:short)%(color:reset)\t%(contents:subject)%(end)\"
h-branches = !echo 'brv (git-extras)'
tags = tag -l --sort=-creatordate --format='%(refname:short): [%(creatordate:short)] %(subject)'
# * authors: log-authors = shortlog -ns
h-format-htma = !echo '%Cred%h%Creset %Cgreen[%ad] -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset'
commit--interactive= !clear && git status && git commit --interactive
h-unstage = !echo reset HEAD --
h-undoall = !echo reset --soft HEAD^
diff-dirs = diff --dirstat --find-copies --find-renames --histogram --color
h-submodule-delete = !echo 'delete-submodule (git-extras)' # * delete-submodule: rm-submodule = !git submodule deinit -f $1 && rm -rf .git/modules/$1 && git rm -rf $1
submodule-update-merge = submodule update --remote --merge
set-upstream-to-current = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
[diff]
wsErrorHighlight = all
tool = vimdiff
colorMoved = default
submodule = log
[merge]
tool = vimdiff
conflictstyle = diff3
[log]
date = iso
algorithm = histogram
# https://git-scm.com/docs/git-diff#Documentation/git-diff.txt-code--color-movedltmodegtcode
colorMoved = dimmed-zebra
mnemonicPrefix = true
renames = true
[interactive]
diffFilter = delta --color-only
[merge]
tool = vimdiff
conflictstyle = zdiff3
[delta] # [dandavison/delta: A syntax-highlighting pager for git, diff, and grep output](https://github.com/dandavison/delta)
syntax-theme= Visual Studio Dark+
navigate = true
side-by-side = true
line-numbers = true
[gc]
reflogExpire = 200
reflogExpireUnreachable = 90
[push]
autoSetupRemote = true
[commit]
gpgsign = true
[rerere]
enabled = true
[credential "https://github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://git.dhl.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[diff "exif"]
textconv = exiftool
[difftool "kommitdiff"]
cmd = kommitdiff \"$LOCAL\" \"$REMOTE\"
[mergetool "kommitmerge"]
cmd = kommitmerge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
trustExitCode = true
[maintenance]
repo = /home/jaandrle/Vzdálené/GitHub/dcp-fe-container-certifedpassport
repo = /home/jaandrle/Vzdálené/GitHub/DHLC-Internet-Networking-old
repo = /home/jaandrle/Vzdálené/GitHub/DGF-Certified-Supervisory-Academy
[submodule]
recurse = true
[format]
coverLetter = auto
compactSummary = true
minimal = true
signOff = true
outputDirectory = .patches
thread = shallow
numbered = auto
[am]
# keepcr = true # to preserve line endings
threeWay = true
[include]
path = ./identities/current.conf

View File

@ -0,0 +1,21 @@
[user]
name = Jan Andrle
email = andrle.jan@centrum.cz
signingkey = B3A25AED155AFFAB
[credential]
# see https://stackoverflow.com/questions/5343068/is-there-a-way-to-cache-https-credentials-for-pushing-commits/18362082#18362082
helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
[credential "https://github.com"]
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper = !/usr/bin/gh auth git-credential
[credential "https://git.dhl.com"]
helper = !/usr/bin/gh auth git-credential
[sendemail]
anotate = true
smtpserver = smtp.centrum.cz
# chainReplyTo = false
suppresscc = self
smtpuser = andrle.jan@centrum.cz
smtpencryption = ssl
smtpserverport = 465

View File

@ -21,8 +21,8 @@
"exec": "yes",
"description": "AI Browser",
"glare": "AppImage",
"last_update": "2025-01-01T14:34:08Z",
"version": "3.2.0",
"last_update": "2025-04-01T05:57:12Z",
"version": "3.8.0",
"downloads": "/home/jaandrle/bin/pinokio"
},
{
@ -136,9 +136,9 @@
"group": "nondev",
"file_name": "fedistar.appimage",
"exec": "yes",
"last_update": "2025-01-04T02:33:29Z",
"last_update": "2025-04-08T11:56:38Z",
"downloads": "/home/jaandrle/bin/fedistar.appimage",
"version": "v1.10.1",
"version": "v1.11.3",
"glare": ".*amd64.*.AppImage"
},
{
@ -148,9 +148,9 @@
"group": "ai",
"file_name": "ollama",
"exec": "yes",
"last_update": "2024-12-17T21:54:59Z",
"last_update": "2025-04-26T09:16:02Z",
"downloads": "/home/jaandrle/bin/ollama",
"version": "v0.5.4",
"version": "v0.6.7-rc1",
"glare": "linux-amd64"
},
{
@ -173,8 +173,8 @@
"file_name": "vim",
"exec": "yes",
"downloads": "/home/jaandrle/bin/vim",
"version": "v9.1.0990",
"last_update": "2025-01-06T01:20:31Z",
"version": "v9.1.1355",
"last_update": "2025-04-30T01:25:38Z",
"glare": "GVim.*x86_64.*.AppImage"
},
{
@ -184,9 +184,9 @@
"group": "dev",
"file_name": "escrcpy.appimage",
"exec": "yes",
"last_update": "2024-12-28T11:05:28Z",
"last_update": "2025-04-27T07:04:58Z",
"downloads": "/home/jaandrle/bin/escrcpy.appimage",
"version": "v1.28.3",
"version": "v1.29.6",
"glare": ".*x86_64.*.AppImage"
},
{
@ -208,9 +208,9 @@
"group": "ai",
"file_name": "jan",
"exec": "yes",
"last_update": "2025-01-06T08:15:48Z",
"last_update": "2025-03-24T02:02:04Z",
"downloads": "/home/jaandrle/bin/jan",
"version": "v0.5.13",
"version": "v0.5.16",
"glare": ".*x86_64.*.AppImage"
},
{
@ -220,9 +220,9 @@
"group": "ai",
"file_name": "Chatbox",
"exec": "yes",
"last_update": "2024-12-16T12:18:19Z",
"last_update": "2025-01-14T13:29:06Z",
"downloads": "/home/jaandrle/bin/Chatbox",
"version": "v0.10.3",
"version": "v0.10.4",
"glare": ".*x86_64.*.AppImage"
},
{
@ -234,8 +234,20 @@
"exec": "yes",
"downloads": "/home/jaandrle/bin/r-quick-share",
"glare": ".*main.*amd64.AppImage",
"last_update": "2024-08-21T21:17:54Z",
"version": "v0.11.2"
"last_update": "2025-02-23T18:15:49Z",
"version": "v0.11.5"
},
{
"repository": "konnektoren/konnektoren-mobile-app",
"group": "nondev",
"name": "Konnektoren",
"description": "Konnektoren Mobile App (learning german) — https://konnektoren.help/home/",
"file_name": "konnektoren",
"exec": "yes",
"downloads": "/home/jaandrle/bin/konnektoren",
"glare": "AppImage",
"last_update": "2025-04-27T07:33:51Z",
"version": "konnektoren-mobile-app-v0.1.4"
}
]
}
}

View File

@ -1,3 +1,4 @@
{
"draw_white_space": "all"
"draw_white_space": "all",
"word_wrap": true,
}

View File

@ -9,4 +9,5 @@
"signature_error_highlighting": "no_public_key",
"theme": "Merge Dark.sublime-theme",
"expand_merge_commits_by_default": true,
"ignore_diff_white_space": false,
}

View File

@ -27,19 +27,18 @@
"" #region G General
" set vicmd=elvis\ -G\ termcap | " set vicmd=vile
set vicmd=vim
"set vimhelp
command! README :!vim ~/Dokumenty/GitHub/dotfiles/vifm/README.md
command! Help :!vim ~/.config/vifm/vifm-help.txt
map <f1> :Help<cr>
cabbrev help Help
" cabbrev help Help
set vimhelp
if !has('win')
set fusehome=/tmp/vifm_FUSE
set slowfs=curlftpfs
endif
set syscalls norunexec
" Automatically resolve symbolic links on l or Enter.
set nofollowlinks
set trash
set notrash
nmap dd :!trash %"f<cr>
nmap d? :exe "!clear && echo 'Native system trash (`trash-cli`): use `trash`|`trash-empty`|`trash-list`|`trash-put`|`trash-restore`|`trash-rm`' && trash-list | sort -r" | shell<cr>
set history=100 undolevels=100
@ -291,8 +290,8 @@
fileviewer <video/*>,<audio/*> mediainfo %c
endif
" #endregion FmediaBin
fileviewer .*/,*/ tree %c -L 3 &
fileviewer ../ tree %c -L 1 &
fileviewer .*/,*/ tree %c -L 3 -C &
fileviewer ../ tree %c -L 1 -C &
fileviewer *.js,*.mjs,*.ts,*.sh,
\*.css,*.scss,
\*.php,

View File

@ -14,3 +14,6 @@ Parent=FALLBACK/
[Scrolling]
HistoryMode=2
ScrollBarPosition=2
[Terminal Features]
BellMode=1

View File

@ -1,3 +1,5 @@
Include /home/jaandrle/.config/colima/ssh_config
Host vpsfree
HostName 37.205.11.208
IdentityFile ~/.ssh/vpsfree

View File

@ -1,6 +0,0 @@
nmap <leader>vd /diff --git<cr> 0vG$
command! AIcommit ALTredir !§ai-commit.mjs
command! AIcommitConventional ALTredir !§ai-commit.mjs --format conventional
command! AIcommitGitmoji ALTredir !§ai-commit.mjs --format gitmoji
command! AIcommitGit3moji ALTredir !§ai-commit.mjs --format git3moji
nmap <leader><f1> :AIcommitOP

View File

@ -26,5 +26,6 @@
"complexity": ["error", 15]
}
}
}
},
"snippets.ultisnips.pythonPrompt": false
}

167
.vimrc
View File

@ -1,7 +1,7 @@
""" VIM config file | Jan Andrle | 2025-01-07 (VIM >=9.1 AppImage)
""" VIM config file | Jan Andrle | 2025-04-05 (VIM >=9.1 AppImage)
"" #region B Base
scriptencoding utf-8 | set encoding=utf-8
set pythonthreedll=/lib/x86_64-linux-gnu/libpython3.10.so.1.0
set pythonthreedll=/lib/x86_64-linux-gnu/libpython3.12.so.1.0
let $BASH_ENV = "~/.bashrc"
set runtimepath^=~/.vim/bundle/*
packadd! matchit
@ -12,7 +12,7 @@
set title
colorscheme codedark
set updatetime=300 lazyredraw ttyfast " Having longer updatetime (default is 4s) leads to noticeable delays and poor user experience. Also reduce redraw frequency and fast terminal typing
set updatetime=300 "TODO DEL lazyredraw
set noerrorbells novisualbell
set belloff=esc
set confirm
@ -60,8 +60,6 @@
cabbrev ALTR ALTredrawSyntax
command! -nargs=0
\ ALTredrawSyntax edit | exec 'normal `"' | exec 'set ft='.&ft
command! -complete=command -bar -range -nargs=+
\ ALTredir call jaandrle_utils#redir(0, <q-args>, <range>, <line1>, <line2>)
let g:quickfix_len= 0
function! QuickFixStatus() abort
@ -90,21 +88,15 @@
cabbrev wbw w<bar>bw
set sessionoptions-=options
" TODO DEL
command! -nargs=1
\ CLSESSIONcreate :call mini_sessions#create(<f-args>)
command! -nargs=0
\ CLSESSIONconfig :call mini_sessions#sessionConfig()
command! -nargs=1 -complete=customlist,mini_sessions#complete
\ CLSESSIONload :call mini_sessions#load(<f-args>)
command! -nargs=0
\ Scd :call mini_sessions#recoverPwd()
if !has("gui_running")
execute 'hi! User2 ctermbg='.synIDattr(synIDtrans(hlID('StatusLine')), 'bg').' ctermfg=grey' | endif
function! NumberOfBuffers()
return len(filter(range(1, bufnr('$')), 'buflisted(v:val)'))
endfunction
set laststatus=2 " Show status line on startup
set statusline+=··%1*≡·%{QuickFixStatus()}%*··%2*»·%{user_tips#current()}%*··%=
set statusline+=%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype}··∷·%{mini_sessions#name('')}·· 
set statusline+=··≡·%{QuickFixStatus()}%*··»·%{user_tips#current()}%*··%=
set statusline+=(%{NumberOfBuffers()})··%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype}
set statusline+=··
" set statusline+=··∷·%{mini_sessions#name('')}·· 
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
@ -114,8 +106,7 @@
command! SETundoClear let old_undolevels=&undolevels | set undolevels=-1 | exe "normal a \<BS>\<Esc>" | let &undolevels=old_undolevels | unlet old_undolevels | write
"" #endregion SLH
"" #region LLW Left Column + Line + Wrap + Scrolling
if has("nvim-0.5.0") || has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one
set signcolumn=number | else | set signcolumn=yes | endif " show always to prevent shifting when diagnosticappears
set signcolumn=yes
set cursorline cursorcolumn " Always show current position
set number foldcolumn=2 " enable line numbers and add a bit extra margin to the left
set colorcolumn=+1 " …marker visual
@ -129,26 +120,53 @@
"" #endregion LLW
"" #region CN Clipboard + Navigation throught Buffers + Windows + … (CtrlP)
set pastetoggle=<F2> | nnoremap <F2> :set invpaste paste?<CR>
nnoremap <silent> <leader>" :call jaandrle_utils#copyRegister()<cr>
function! JaaCopyRegister()
echo "Copy content of the register: "
let sourceReg = nr2char(getchar())
if sourceReg !~# '\v^[a-z0-9"*+]'
echon sourceReg." invalid register"
return
endif
echon sourceReg."\ninto the register: "
let destinationReg = nr2char(getchar())
if destinationReg !~# '\v^[a-z0-9"*+]'
echon destinationReg." invalid register"
return
endif
call setreg(destinationReg, getreg(sourceReg, 1))
echon destinationReg
endfunction
nnoremap <silent> <leader>" :call JaaCopyRegister()<cr>
nmap <expr> š buffer_number("#")==-1 ? "\<leader>š<cr>" : "\<c-^>"
" CtrlP previously
nmap <expr> š buffer_number("#")==-1 ? ":CocList --normal buffers\<cr>" : "\<c-^>"
nmap ě :CocList
nmap <leader>3 :buffers<cr>:b<space>
nmap <leader>š :CtrlPBuffer<cr>
nmap <leader>š :CocList buffers<cr> | :syntax on<cr>
nmap č <leader>š
let g:ctrlp_map = 'ě'
command! -nargs=? SETctrlp execute 'nnoremap '.g:ctrlp_map.' :CtrlP <args><cr>'
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_prompt_mappings= {
\ 'ToggleType(1)': ['<c-up>'],
\ 'ToggleType(-1)': ['<c-down>'],
\ 'PrtCurStart()': ['<c-b>'],
\}
"" #endregion CN
"" #region FOS File(s) + Openning + Saving
set autowrite autoread | autocmd FocusGained,BufEnter *.* checktime
set modeline
command! -nargs=?
\ CLmodeline :call jaandrle_utils#AppendModeline(<q-args>=='basic' ? 0 : 1)
function! JaaAppendModeline(additional= 0)
let l:modeline= printf(" vim: set tabstop=%d shiftwidth=%d textwidth=%d %sexpandtab :",
\ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
let l:modeline= substitute(&commentstring, "%s", l:modeline, "")
call append(line("$"), l:modeline)
if !a:additional | return 0 | endif
if &foldmethod=="marker"
let l:modeline= printf(" vim>60: set foldmethod=marker foldmarker=%s :",
\ &foldmarker)
elseif &foldmethod=="indent"
let l:modeline= printf(" vim>60: set foldmethod=indent foldlevel=%d foldnestmax=%d:",
\ &foldlevel, &foldnestmax)
else
return 0
endif
let l:modeline= substitute(&commentstring, "%s", l:modeline, "")
call append(line("$"), l:modeline)
endfunction
set path+=src/**,app/**,build/** " File matching for `:find`
for ignore in [ '.git', '.npm', 'node_modules' ]
@ -166,7 +184,7 @@
set grepprg=LC_ALL=C\ grep\ -HRIns
set hlsearch incsearch " highlight search, start when typing
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif
nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif " TODO? <bar>syntax sync fromstart
let g:markbar_persist_mark_names = v:false
let g:markbar_cache_with_hidden_buffers = v:false " last buffers are reopened as hidden https://github.com/Yilin-Yang/vim-markbar/blob/9f5a948d44652074bf2b90d3da6a400d8a369ba5/doc/vim-markbar.txt#L136
@ -196,8 +214,9 @@
let g:rainbow#blacklist = [203,9]
autocmd VimEnter * try
\| call rainbow_parentheses#toggle() | catch | endtry
" HIGHLIGHT&YANK plugins machakann/vim-highlightedyank & cwordhi.vim
let g:highlightedyank_highlight_duration= 250
" HIGHLIGHT&YANK plugins (buildin) hlyank & cwordhi.vim
packadd hlyank
let g:hlyank_duration= 250
let g:cwordhi#autoload= 1
set showmatch " Quick highlight oppening bracket/… for currently writted
set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape TAB
@ -214,11 +233,12 @@
if ($TERM =~ '256' && has("termguicolors"))
set termguicolors | endif
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
syntax on | endif
syntax enable | endif
set list listchars=tab:»·,trail,extends:#,nbsp:~,space" Highlight spec. chars / Display extra whitespace
set redrawtime=10000
augroup syntax_sync_min_lines
autocmd!
autocmd Syntax * syn sync minlines=2000
autocmd BufEnter * syntax sync fromstart "TODO DEL syn sync minlines=2000
augroup END
let g:vim_vue_plugin_config = { 'foldexpr': 1, 'attribute': 1, 'keyword': 1 }
" SPELL
@ -230,7 +250,7 @@
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' ]
execute m.'noremap <leader>'.l.' "+'.l | endfor | endfor
execute m.'map <leader>'.l.' "+'.l | endfor | endfor " no noremap ⇐ https://github.com/jasonccox/vim-wayland-clipboard?tab=readme-ov-file#non-recursive-mappings
" TODO DEL: FOLDS
" TODO DEL: command! -nargs=0 SETFOLDregions set foldmethod=marker
" TODO DEL: command! -nargs=1 SETFOLDindent set foldmethod=indent | let &foldlevel=<q-args> | let &foldnestmax=<q-args>+1
@ -244,41 +264,6 @@
autocmd BufWinEnter *.* silent! loadview
augroup END
"" #endregion EA
"" #region GIT
function s:gitCompletion(_, CmdLine, __)
let l:cmd= a:CmdLine->split()
let l:cmd_start= l:cmd[0]
\ ->substitute('GIThub', 'gh', '')
\ ->substitute('GIT', 'git ', '')->trim()->split(' ')
return bash#complete((l:cmd_start+l:cmd[1:])->join())
endfunction
function s:gitCmd(candidate)
execute '!clear && echo ":: git '.a:candidate->escape('"').' ::" && git '.a:candidate
endfunction
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GIT call <sid>gitCmd(<q-args>)
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITstatus !git status-- <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITcommit !git commit-- <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITpush !git push <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITdiff if <q-args>=='' | execute '!clear && git diff %:p' | else | silent! execute '!git diff <args>' | endif
command! -nargs=*
\ GITrestore execute '!clear && git status '.(<q-args>=='.' ? '%:p':'<args>').' -bs & git restore '.(<q-args>=='' ? '%:p':'<args>').' --patch'
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GIThub execute '!clear && echo ":: gh '.<q-args>->escape('"').' ::" && gh '.<q-args>
command! -nargs=?
\ GIThubIssue execute '!clear && gh issue view '.expand('<cword>').' '.<q-args>
let g:git_messenger_no_default_mappings= v:true
let g:git_messenger_date_format= '%Y-%m-%d (%c)'
let g:git_messenger_always_into_popup= v:true
augroup git_messenger_help
autocmd!
autocmd FileType gitmessengerpopup setlocal keywordprg=git\ show
augroup END
"" #endregion GIT
"" #region AI
let g:codeium_disable_bindings = 1
imap <script><silent><nowait><expr> <f3><f3> codeium#Accept()
@ -290,7 +275,7 @@ imap <f3>d <Cmd>call codeium#Clear()<CR>
imap <f3>! <Cmd>call codeium#Complete()<CR>
"" #endregion AI
"" #region COC COC and so on, compilers, code/commands completions
let g:coc_global_extensions= ['coc-css', 'coc-docthis', 'coc-emmet', 'coc-emoji', 'coc-pretty-ts-errors', 'coc-eslint', 'coc-gitmoji', 'coc-html', 'coc-json', 'coc-marketplace', 'coc-phpls', 'coc-sh', 'coc-snippets', 'coc-styled-components', 'coc-svg', 'coc-tabnine', 'coc-tsserver']
let g:coc_global_extensions= ['coc-css', 'coc-docthis', 'coc-emmet', 'coc-emoji', 'coc-git', 'coc-pretty-ts-errors', 'coc-eslint', 'coc-gitmoji', 'coc-html', 'coc-json', 'coc-lists', 'coc-marketplace', 'coc-phpls', 'coc-sh', 'coc-snippets', 'coc-styled-components', 'coc-svg', 'coc-tsserver']
" https://github.com/antonk52/cssmodules-language-server
call coc#config('languageserver.cssmodules', {
\ "command": "cssmodules-language-server",
@ -322,7 +307,7 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
return !col || getline('.')[col - 1] =~# '\s'
endfunction
nmap <silent> gd <Plug>(coc-definition)
nmap <silent><nowait> gd <Plug>(coc-definition)
command! -nargs=* -complete=customlist,<sid>SCommandCocActionComplete CocAction call CocActionAsync(<f-args>)
function s:SCommandCocActionComplete(argLead, cmdLine, cursorPos)
return readfile(expand('~/.vim/pack/coc/start/coc.nvim/doc/tags'), 'r')
@ -333,8 +318,8 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
" navigate diagnostics, use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nnoremap <silent> gh :call <sid>show_documentation(expand("<cword>"))<cr>
vnoremap <silent> gh :<c-u>call <sid>show_documentation(mini_enhancement#selectedText())<cr>
nnoremap <leader>gf :let g:ctrlp_default_input=expand("<cword>") <bar> execute 'CtrlP' <bar> unlet g:ctrlp_default_input <cr>
vnoremap <leader>gf :<c-u>let g:ctrlp_default_input=mini_enhancement#selectedText() <bar> execute 'CtrlP' <bar> unlet g:ctrlp_default_input <cr>
nnoremap <leader>gf :CocList --interactive --normal --input='<c-r>=expand("<cword>")<cr>' files<cr>
vnoremap <leader>gf :<c-u>CocList --interactive --normal --input='<c-r>=mini_enhancement#selectedText()<cr>' files<cr>
""" #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')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
@ -348,7 +333,7 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
command! -nargs=? CLhelpMy if <q-args>!='' | exec 'map '.<q-args> | else | call popup_notification([
\ 'Custom mappings starting: '.mapleader.',§, ů, ;, U, ž',
\ 'Custom commands starting: CL, SET, ALT, CtrlP, Vifm, GIT, Coc',
\ 'Custom commands starting: CL, SET, ALT, Vifm, Coc',
\ 'Helpful commands: CocAction, CocCommand, CocList',
\], #{ line: &lines-3, pos: 'botleft', moved: 'any', close: 'button', time: 6000 }) | endif
nnoremap <c-g> :CLwhereami<cr>
@ -384,27 +369,6 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
\ CLcheat call cheat_copilot#open(<q-args>==''?&filetype:<q-args>)
function! s:show_documentation(word)
if (index(['vim', 'help'], &filetype) >= 0)
" inspired by https://github.com/tpope/vim-scriptease/blob/74bd5bf46a63b982b100466f9fd47d2d0597fcdd/autoload/scriptease.vim#L737
let syn= get(reverse(map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")')), 0, '')
if syn ==# 'vimFuncName' | return <sid>show_documentation_vim('h '.a:word.'()')
elseif syn ==# 'vimOption' | return <sid>show_documentation_vim("h '".a:word."'")
elseif syn ==# 'vimUserAttrbKey' | return <sid>show_documentation_vim('h :command-'.a:word)
endif
let col= col('.') - 1
while col && getline('.')[col] =~# '\k' | let col-= 1 | endwhile
let pre= col == 0 ? '' : getline('.')[0 : col]
let col= col('.') - 1
while col && getline('.')[col] =~# '\k' | let col+= 1 | endwhile
if pre =~# '^\s*:\=$' | return <sid>show_documentation_vim('h :'.a:word)
elseif pre =~# '\<v:$' | return <sid>show_documentation_vim('h v:'.a:word)
endif
let post= getline('.')[col : -0]
if a:word ==# 'v' && post =~# ':\w\+' | return <sid>show_documentation_vim('h v'.matchstr(post, ':\w\+')) | endif
return <sid>show_documentation_vim('h '.a:word)
endif
if (!CocAction('hasProvider', 'hover'))
if &filetype=='man' | call dist#man#PreGetPage(0) | return 0 | endif
return feedkeys('K', 'in')
@ -415,9 +379,6 @@ imap <f3>! <Cmd>call codeium#Complete()<CR>
return CocActionAsync('doHover')
endfunction
function! s:show_documentation_vim(cmd)
call execute(a:cmd) | call histadd("cmd", a:cmd)
endfunction
"" #endregion COC
" vim: set textwidth=250 :

File diff suppressed because it is too large Load Diff

39
bin/git-identity Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
config="$HOME/.config/git/identities"
input="${1:-}"
usage="Usage
git identity [<name>|help|-]
git-identity --help
"
[ -z "$input" ] \
&& echo "$usage"\
&& echo -e "$config/current.conf … current identity:" \
&& cat "$config/current.conf" \
&& exit 0
[ "$input" = --help ] \
&& input="help"
[ "$input" = help ] \
&& echo "$usage"\
&& echo '- _empty_: shows usage and current identity' \
&& echo '- <name>: set identity' \
&& echo '- -: show path to identities directory' \
&& echo '- help: shows this help' \
&& echo -e '\n\nExamples' \
&& echo '- git identity' \
&& echo '- git identity user' \
&& echo '- ls $(git identity -)' \
&& echo -e '\n\nGit config' \
&& echo "- git config --global include.path '$config/current.conf'" \
&& exit 0
[ "$input" = - ] \
&& echo "$config" \
&& exit 0
identity="$config/$input.conf"
[ ! -e "$identity" ] \
&& echo "No such identity: $input" >&2 \
&& echo "$identity" >&2 \
&& exit 1
ln --verbose --force "$identity" "$config/current.conf"

View File

@ -1,9 +0,0 @@
#!/bin/bash
if [[ $(mount | grep OneDrive) ]]; then
fusermount -uz ~/Vzdálené/OneDrive
notify-send -i system-file-manager "OneDrive disk ODPOJEN"
else
rclone --vfs-cache-mode full mount "onedrive": ~/Vzdálené/OneDrive &
dolphin ~/Vzdálené/OneDrive/ &
notify-send -i system-file-manager "OneDrive disk PŘIPOJEN"
fi

View File

@ -1,10 +0,0 @@
[ ! -r ~/.config/pocketshaddrc ] && echo "\`~/.config/pocketshaddrc\` not found" && exit 1
. ~/.config/pocketshaddrc
curl -sS -X POST \
-F "url=$1" \
-F "title=$2" \
-F "consumer_key=$CONSUMER_KEY" \
-F "access_token=$ACCESS_TOKEN" \
https://getpocket.com/v3/add \
> /dev/null

View File

@ -9,7 +9,7 @@ const path_home= $.xdg.home`Obrázky/Bing Image Of The Day/`;
const path_info= join(path_home, "images.json");
$.api()
.version("2025-01-06")
.version("2025-04-02")
.command("pull", "Pull new/today image(s)")
.action(async function pull(){
const images= {
@ -24,6 +24,7 @@ $.api()
{});
convert(paths, images_save);
s.echo(JSON.stringify(images_save, null, "\t")).to(path_info);
newPanel(images_save.now);
$.exit(0);
})
.command("redraw")
@ -31,6 +32,7 @@ $.api()
const paths= [ "now", "prev" ].map(key=> join(path_home, `${key}.jpg`));
const images= s.cat(path_info).xargs(JSON.parse);
convert(paths, images);
newPanel(images.now);
$.exit(0);
})
.command("status")
@ -41,6 +43,10 @@ $.api()
$.exit(0);
})
.parse();
function newPanel(caption){
const link= `<a href="https://commons.wikimedia.org/wiki/Template:Potd/${dateISO(0)} (cs)">(i)</a>`;
s.sed("-i", /\<aside\>.*?\<\/aside\>/, `<aside>${link} ${caption}</aside>`, join(path_home, "Nový panel.html"));
}
/** @typedef {{ url: string, caption: string }} T_response */
/** @typedef {Record<"now"|"prev",T_response>} T_images */
/** @param {Record<"now"|"prev",string>} paths */