From 59b844443f5a5c867a98f8b89dce5b9c6ce3783f Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 31 Aug 2022 08:41:28 -0400 Subject: yep --- .config/zsh/.zshrc | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) (limited to '.config/zsh/.zshrc') diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index fb7a675..3857da9 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -2,18 +2,20 @@ # getchoo's zshrc # -# bootstrap antidote -antidote_dir="$ZDOTDIR/.antidote" -plugins_file="$ZDOTDIR/.zsh_plugins.txt" -static_file="$ZDOTDIR/.zsh_plugins.zsh" +local zdump="${XDG_CACHE_HOME}/zsh/zcompdump" +local antidote_dir="${ZDOTDIR}/.antidote" +local plugins_file="${ZDOTDIR}/.zsh_plugins.txt" +local static_file="${ZDOTDIR}/.zsh_plugins.zsh" zstyle ':antidote:bundle' use-friendly-names 'yes' # don't use ugly dirs +# recompile static file when needed if [[ ! "$static_file" -nt "$plugins_file" ]] then - [[ ! -e "$antidote_dir" ]] && \ + # bootstrap antidote + [[ ! -e "$antidote_dir/antidote.zsh" ]] && \ git clone --depth=1 https://github.com/mattmc3/antidote.git "$antidote_dir" - source "$antidote_dir/antidote.zsh" + source "${antidote_dir}/antidote.zsh" [[ ! -e "$plugins_file" ]] && touch "$plugins_file" antidote bundle < "$plugins_file" > "$static_file" fi @@ -23,26 +25,34 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] fi # zmodules -autoload -U compinit colors "$antidote_dir/antidote.zsh" +autoload -Uz compinit colors "${antidote_dir}/antidote.zsh" colors +zmodload zsh/zutil zmodload zsh/complist -zstyle ':completion:*' menu select reshash true -zstyle ':completion::complete:*' use-cache on - -# load plugins -source "$static_file" -unset antidote_dir +zstyle ':completion::*' completer _extensions _complete _approximate +zstyle ':completion::*' group-name '' +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-dirs-first true +zstyle ':completion:*' menu select +zstyle ':completion::*' use-cache on +zstyle ':completion::*' cache-path "$zdump" # compile completion -zdump="$ZDOTDIR/.zcompdump" compinit -d "$zdump" -if [[ ! "$zdump.zwc" -nt "$zdump" ]] +if [[ ! "${zdump}.zwc" -nt "$zdump" ]] then zcompile "$zdump" fi +# load plugins +source "$static_file" + # options -setopt append_history +unsetopt hist_beep +unsetopt list_beep +setopt hist_expire_dups_first +setopt hist_ignore_dups +setopt hist_ignore_space setopt inc_append_history setopt prompt_subst setopt share_history @@ -64,12 +74,12 @@ zle -N clear-screen-and-scrollback bindkey '^L' clear-screen-and-scrollback # enable history -HISTFILE="$XDG_STATE_HOME/zsh/history" +HISTFILE="${XDG_STATE_HOME}/zsh/history" HISTSIZE=100 SAVEHIST=1000 # source aliases -source "$XDG_CONFIG_HOME/shell/aliases" +source "${XDG_CONFIG_HOME}/shell/aliases" # To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh -- cgit v1.2.3