From 91ae0eff0b853ff80eec1c02634c8d36b1e9b02e Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Wed, 4 Feb 2026 10:55:33 +0100 Subject: switch to antidote --- .config/shell/.zsh_plugins | 5 ++++ .config/shell/.zshrc | 61 +++++++++++++++++++++------------------------- .config/shell/aliasrc | 1 + .config/shell/envvarrc | 12 ++++----- 4 files changed, 40 insertions(+), 39 deletions(-) create mode 100644 .config/shell/.zsh_plugins (limited to '.config/shell') diff --git a/.config/shell/.zsh_plugins b/.config/shell/.zsh_plugins new file mode 100644 index 0000000..8e82b2a --- /dev/null +++ b/.config/shell/.zsh_plugins @@ -0,0 +1,5 @@ +jeffreytse/zsh-vi-mode +zsh-users/zsh-autosuggestions +zsh-users/zsh-completions +zsh-users/zsh-history-substring-search +zsh-users/zsh-syntax-highlighting diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc index 4b69802..028b8b8 100644 --- a/.config/shell/.zshrc +++ b/.config/shell/.zshrc @@ -4,9 +4,10 @@ # ─── 1) Fundamental environment ────────────────────────────────────────────── [ -f "$ALIASRC" ] && source "$ALIASRC" +fpath=(/usr/share/zsh/site-functions $fpath) # ─── 2) Shell behaviour ────────────────────────────────────────────────────── -autoload -U colors && colors +autoload -Uz colors && colors setopt auto_pushd setopt no_check_jobs setopt pushd_ignore_dups @@ -43,6 +44,8 @@ setopt inc_append_history setopt hist_ignore_all_dups setopt hist_find_no_dups setopt hist_save_no_dups +setopt hist_reduce_blanks +setopt hist_ignore_space # ─── 5) Vi mode & ZVM variables ────────────────────────────────────────────── export KEYTIMEOUT=1 @@ -52,32 +55,25 @@ ZVM_CLIPBOARD_COPY_CMD='xclip -selection clipboard' ZVM_CLIPBOARD_PASTE_CMD='xclip -selection clipboard -o' ZVM_LAZY_KEYBINDINGS="false" -# ─── 6) Zinit & plugins ────────────────────────────────────────────────────── -[[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]] && { - print -P "%F{33} Installing %F{220}Zinit…%f" - mkdir -p "$HOME/.local/share/zinit" - git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" -} +# ─── 6) Antidote & plugins ─────────────────────────────────────────────────── +ANTIDOTE_DIR="$HOME/.local/share/antidote" +PLUGIN_FILE="${ZDOTDIR:-$HOME}/.zsh_plugins" +STATIC_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/plugins.zsh" + +# Clone Antidote if not present +[[ -d "$ANTIDOTE_DIR" ]] || git clone --depth=1 https://github.com/mattmc3/antidote.git "$ANTIDOTE_DIR" + +# Source Antidote +source "$ANTIDOTE_DIR/antidote.zsh" -source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" -autoload -Uz _zinit -(( ${+_comps} )) && _comps[zinit]=_zinit - -# Core annexes -zinit light-mode for \ - zdharma-continuum/zinit-annex-as-monitor \ - zdharma-continuum/zinit-annex-bin-gem-node \ - zdharma-continuum/zinit-annex-patch-dl \ - zdharma-continuum/zinit-annex-rust - -# Plugins: **vi-mode first, then autosuggestions, then others** -zinit ice depth=1 -zinit light-mode for \ - jeffreytse/zsh-vi-mode \ - zsh-users/zsh-autosuggestions \ - zsh-users/zsh-completions \ - zsh-users/zsh-history-substring-search \ - zsh-users/zsh-syntax-highlighting +# Initialize/Update the static load file if the plugin list changed +if [[ ! "$STATIC_FILE" -nt "$PLUGIN_FILE" ]]; then + mkdir -p "$(dirname "$STATIC_FILE")" + antidote bundle < "$PLUGIN_FILE" > "$STATIC_FILE" +fi + +# Load the plugins +source "$STATIC_FILE" # Autosuggestions config ZSH_AUTOSUGGEST_STRATEGY=(history completion) @@ -87,15 +83,14 @@ ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=100 # ─── 7) Completion ─────────────────────────────────────────────────────────── # Run compinit **after all plugins** to avoid wiping widgets autoload -Uz compinit -for dump in "${ZDOTDIR:-$HOME}/.zcompdump"(N.m1); do - compinit - break -done -compinit -C +if [[ -n ${ZDOTDIR:-$HOME}/.zcompdump(#qN.m1) ]]; then + compinit -C +else + compinit +fi zstyle ':completion:*' menu select zmodload zsh/complist -fpath=(/usr/share/zsh/site-functions $fpath) -_comp_options+=(globdots) # hidden files +_comp_options+=(globdots) # ─── 8) Keybindings ────────────────────────────────────────────────────────── # Better backspace in vi mode diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 32f1824..172b5bf 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -46,6 +46,7 @@ alias \ alias \ ctg="ssh git@rabiega.xyz" \ cts="ssh root@rabiega.xyz" \ + ctc="ssh root@chadguide.site" \ # Making stuff shorter alias \ diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc index 5409662..9974529 100644 --- a/.config/shell/envvarrc +++ b/.config/shell/envvarrc @@ -29,7 +29,12 @@ for dir in \ "$HOME/.cargo/bin" \ "$HOME/.local/bin" do - [ -d "$dir" ] && PATH="$dir:$PATH" + [ -d "$dir" ] || continue + + case ":$PATH:" in + *":$dir:"*) ;; + *) PATH="$dir:$PATH" ;; + esac done export PATH @@ -66,11 +71,6 @@ export IPYTHONDIR="$XDG_CONFIG_HOME/ipython" export RENPY_USER="$HOME/langs/python/renpy" -# ZSH -export ZVM_SYSTEM_CLIPBOARD_ENABLED="true" -export ZVM_CLIPBOARD_COPY_CMD="xclip -selection clipboard" -export ZVM_CLIPBOARD_PASTE_CMD="xclip -selection clipboard -o" - # Neovim export NVIMPLUGINS="$XDG_CONFIG_HOME/nvim/lua/plugins" export NVIMSNIPPETS="$XDG_CONFIG_HOME/nvim/lua/snips" -- cgit v1.2.3