summaryrefslogtreecommitdiff
path: root/.config/shell/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell/.zshrc')
-rw-r--r--.config/shell/.zshrc61
1 files changed, 28 insertions, 33 deletions
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