From 46e9b50a134941b576f3768d8aeb63fbfaa64a32 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Sat, 22 Feb 2025 14:36:08 +0100 Subject: [PATCH] :zap: (bash) crossSession, m; (git) interactive (+vim) --- .bash/.bash_aliases | 49 +++++++++++++++++-- .config/geany/filetype_extensions.conf | 2 +- .config/github-releases/config.json | 32 ++++++------ .../Packages/User/Diff.sublime-settings | 3 +- .local/share/konsole/Můj.profile | 3 ++ .vim/coc-settings.json | 3 +- .vimrc | 6 +-- 7 files changed, 71 insertions(+), 27 deletions(-) diff --git a/.bash/.bash_aliases b/.bash/.bash_aliases index bc2fe85..056a147 100644 --- a/.bash/.bash_aliases +++ b/.bash/.bash_aliases @@ -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 []' + echo ' Sets cross session variable to (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 ' + echo ' Deletes mark . Unsets variable and cross session variable.' echo 'm [path]' echo ' Sets mark to current directory or [path].' echo ' The mark is just a bash variable, use `$m`.' @@ -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 -`' diff --git a/.config/geany/filetype_extensions.conf b/.config/geany/filetype_extensions.conf index ee89846..d95a947 100644 --- a/.config/geany/filetype_extensions.conf +++ b/.config/geany/filetype_extensions.conf @@ -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; diff --git a/.config/github-releases/config.json b/.config/github-releases/config.json index 202bce2..a6216a4 100644 --- a/.config/github-releases/config.json +++ b/.config/github-releases/config.json @@ -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-02-01T14:42:48Z", + "version": "3.6.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-01-09T12:37:14Z", "downloads": "/home/jaandrle/bin/fedistar.appimage", - "version": "v1.10.1", + "version": "v1.11.0", "glare": ".*amd64.*.AppImage" }, { @@ -148,9 +148,9 @@ "group": "ai", "file_name": "ollama", "exec": "yes", - "last_update": "2024-12-17T21:54:59Z", + "last_update": "2025-02-14T08:25:18Z", "downloads": "/home/jaandrle/bin/ollama", - "version": "v0.5.4", + "version": "v0.5.11", "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.1106", + "last_update": "2025-02-12T01:15:34Z", "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-02-17T13:16:44Z", "downloads": "/home/jaandrle/bin/escrcpy.appimage", - "version": "v1.28.3", + "version": "v1.28.7", "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-02-11T07:09:50Z", "downloads": "/home/jaandrle/bin/jan", - "version": "v0.5.13", + "version": "v0.5.15-rc9-beta", "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,8 @@ "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-01-14T08:36:53Z", + "version": "v0.11.4" } ] } \ No newline at end of file diff --git a/.config/sublime-merge/Packages/User/Diff.sublime-settings b/.config/sublime-merge/Packages/User/Diff.sublime-settings index 0725c1e..324aa71 100644 --- a/.config/sublime-merge/Packages/User/Diff.sublime-settings +++ b/.config/sublime-merge/Packages/User/Diff.sublime-settings @@ -1,3 +1,4 @@ { - "draw_white_space": "all" + "draw_white_space": "all", + "word_wrap": true, } diff --git a/.local/share/konsole/Můj.profile b/.local/share/konsole/Můj.profile index 9bbe052..6a85079 100644 --- a/.local/share/konsole/Můj.profile +++ b/.local/share/konsole/Můj.profile @@ -14,3 +14,6 @@ Parent=FALLBACK/ [Scrolling] HistoryMode=2 ScrollBarPosition=2 + +[Terminal Features] +BellMode=1 diff --git a/.vim/coc-settings.json b/.vim/coc-settings.json index 9fd26d2..4116748 100644 --- a/.vim/coc-settings.json +++ b/.vim/coc-settings.json @@ -26,5 +26,6 @@ "complexity": ["error", 15] } } - } + }, + "snippets.ultisnips.pythonPrompt": false } diff --git a/.vimrc b/.vimrc index a985a9e..10ba584 100644 --- a/.vimrc +++ b/.vimrc @@ -1,7 +1,7 @@ -""" VIM config file | Jan Andrle | 2025-01-07 (VIM >=9.1 AppImage) +""" VIM config file | Jan Andrle | 2025-01-08 (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 @@ -291,7 +291,7 @@ command! -nargs=* -complete=customlist,gitCompletion \ GITstatus !git status-- command! -nargs=* -complete=customlist,gitCompletion - \ GITcommit !git commit-- + \ GITcommit !git commit--interactive-v command! -nargs=* -complete=customlist,gitCompletion \ GITpush !git push command! -nargs=* -complete=customlist,gitCompletion