diff --git a/common/.config/zsh/.zprofile b/common/.config/zsh/.zprofile index a4d8a682..0878233f 100644 --- a/common/.config/zsh/.zprofile +++ b/common/.config/zsh/.zprofile @@ -1,5 +1,3 @@ -set +a - export EDITOR="nvim" export TERMINAL="st" export TERMCMD="$TERMINAL" @@ -34,6 +32,10 @@ export FZF_DEFAULT_OPTS="\ --color=info:#7aa2f7,prompt:#7dcfff,pointer:#7dcfff \ --color=marker:#9ece6a,spinner:#9ece6a,header:#9ece6a \ " +export AUTO_NOTIFY_THRESHOLD=15 +export AUTO_NOTIFY_EXPIRE_TIME=5000 +export AUTO_NOTIFY_TITLE="Command finished execution" +export AUTO_NOTIFY_BODY="%command\nDuration: %elapsed seconds\nExit code: %exit_code" export ANSIBLE_NOCOWS="1" # Stop those fucking cows in Ansible export LESS="-R" export LESSOPEN="| /usr/bin/bat -f %s 2>/dev/null" @@ -80,8 +82,8 @@ export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" export XDG_STATE_HOME="$HOME/.local/state" +set -a; source "$XDG_CONFIG_HOME/user-dirs.dirs"; set +a export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" -set -a; source $XDG_CONFIG_HOME/user-dirs.dirs; set +a export ANDROID_HOME="$XDG_DATA_HOME/android" export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy" export ANSIBLE_GALAXY_TOKEN_PATH="$XDG_DATA_HOME/ansible/galaxy_token" diff --git a/common/.config/zsh/.zshrc b/common/.config/zsh/.zshrc index 1e89a148..ca0a88a0 100644 --- a/common/.config/zsh/.zshrc +++ b/common/.config/zsh/.zshrc @@ -1,8 +1,13 @@ -PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%F{white}%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b ' -RPROMPT='%(?..%F{red}%?) $(venv_prompt)' - -source "${ZDOTDIR}/config/plugins.zsh" - -for f in "functions" "aliases" "hashes" "options" "bindings" "completions" "widgets" "host"; do +for f in \ + "plugins" \ + "functions" \ + "aliases" \ + "hashes" \ + "options" \ + "bindings" \ + "completions" \ + "widgets" \ + "host" +do source "${ZDOTDIR}/config/${f}.zsh" done diff --git a/common/.config/zsh/config/aliases.zsh b/common/.config/zsh/config/aliases.zsh index 5fba90d8..64eb156f 100644 --- a/common/.config/zsh/config/aliases.zsh +++ b/common/.config/zsh/config/aliases.zsh @@ -24,7 +24,7 @@ alias \ ffmpeg="ffmpeg -hide_banner" \ nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings" \ less="less -r" \ - date="date +'%X %x'" + today="date +'%X %x'" # Shortening alias \ diff --git a/common/.config/zsh/config/bindings.zsh b/common/.config/zsh/config/bindings.zsh index 0c266358..3eef67c3 100644 --- a/common/.config/zsh/config/bindings.zsh +++ b/common/.config/zsh/config/bindings.zsh @@ -51,6 +51,7 @@ global_keybinds=( "$key_info[Control]G" lazygit-wrap "$key_info[Control]S" toggle-fzf-tab "$key_info[Control]Z" fancy-ctrl-z + "$key_info[Control]J" jq-complete ) local -A viins_keybinds diff --git a/common/.config/zsh/config/functions.zsh b/common/.config/zsh/config/functions.zsh index 2a55c058..98f36e44 100644 --- a/common/.config/zsh/config/functions.zsh +++ b/common/.config/zsh/config/functions.zsh @@ -13,14 +13,6 @@ function xsi() { --preview-window=right:66%:wrap | xargs -ro xi } -function ntfy() { - "$@" && { - notify-send "$1 completed successfully" - return - } - notify-send -u critical "$1 failed! " "exited with code: $?" -} - function whed() { script=$(which "$1") [ -e "$script" ] && $EDITOR $(which "$script") diff --git a/common/.config/zsh/config/options.zsh b/common/.config/zsh/config/options.zsh index bbc1a83d..bf0e6e3f 100644 --- a/common/.config/zsh/config/options.zsh +++ b/common/.config/zsh/config/options.zsh @@ -1,3 +1,8 @@ +# NOTE: Prompt + +PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%F{white}%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b ' +RPROMPT='%(?..%F{red}%?) $(venv_prompt)' + # NOTE: History [ ! -f "$XDG_DATA_HOME/zsh/history" ] && diff --git a/common/.config/zsh/config/plugins.zsh b/common/.config/zsh/config/plugins.zsh index 49662429..748082a3 100644 --- a/common/.config/zsh/config/plugins.zsh +++ b/common/.config/zsh/config/plugins.zsh @@ -27,22 +27,39 @@ function zsnippet() { turbo zsnippet https://raw.githubusercontent.com/python-virtualenvwrapper/virtualenvwrapper/refs/heads/main/virtualenvwrapper.sh -# NOTE: fzf completion menu +# NOTE: notify on long running commands turbo -zload Aloxaf/fzf-tab +zload MichaelAquilina/zsh-auto-notify -# NOTE: prox +# NOTE: colorize help output +turbo +zload Freed-Wu/zsh-help + +# NOTE: jq repl +turbo +zload reegnz/jq-zsh-plugin + +# NOTE: yank to clipboard +turbo +zload zsh-vi-more/evil-registers +zstyle :zle:evil-registers:'[A-Za-z%#]' editor nvim + +# NOTE: tralios prox turbo as:"program" from:"gitlab.tralios.de" pick:"prox" zload "software/tralios-prox" turbo as:"completion" from:"gitlab.tralios.de" pick:"_prox" zload "software/tralios-prox" -# NOTE: kube program +# NOTE: tralios kube turbo as:"program" from:"gitlab.tralios.de" pick:"kube" zload "software/tralios-kube" turbo as:"completion" from:"gitlab.tralios.de" pick:"_kube" zload "software/tralios-kube" +# NOTE: fzf completion menu +turbo +zload Aloxaf/fzf-tab + # NOTE: autosuggest turbo atload:"_zsh_autosuggest_start" zload /usr/share/zsh/plugins/zsh-autosuggestions diff --git a/common/.config/zsh/config/widgets.zsh b/common/.config/zsh/config/widgets.zsh index 66919a71..8a2eea81 100644 --- a/common/.config/zsh/config/widgets.zsh +++ b/common/.config/zsh/config/widgets.zsh @@ -119,3 +119,5 @@ function workon_cwd() { } } add-zsh-hook chpwd workon_cwd + +eval "$(direnv hook zsh)"