diff --git a/zsh/.config/zsh/.zshenv b/zsh/.config/zsh/.zshenv index 3b40006..3b4e6ac 100644 --- a/zsh/.config/zsh/.zshenv +++ b/zsh/.config/zsh/.zshenv @@ -18,3 +18,8 @@ if [ -d "$XDG_CONFIG_HOME/zsh/env.d" ]; then done unset _env fi + +# add XDG_CONFIG_HOME/zsh/completions to fpath +# zsh uses it to look for completions; throw all +# completions in these dotfiles in there +fpath=("$XDG_CONFIG_HOME/zsh/completions" $fpath) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 4c78b84..227a804 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -4,6 +4,16 @@ CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}" ZSHCONFDIR="$CONFDIR/zsh" +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block, everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# load all plugins +[ -f "$ZSHCONFDIR/plugins.zsh" ] && source "$ZSHCONFDIR/plugins.zsh" + # Set completion style # The following lines were added by compinstall zstyle ':completion:*' completer _complete _ignored _approximate @@ -16,17 +26,6 @@ zstyle :compinstall filename "$ZSHCONFDIR/.zshrc" autoload -Uz compinit zmv compinit -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block, everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - - -# load all plugins -[ -f "$ZSHCONFDIR/plugins.zsh" ] && source "$ZSHCONFDIR/plugins.zsh" - # shellcheck source=alias [ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias" # load additional aliases @@ -53,7 +52,7 @@ ENABLE_CORRECTION="true" # Speed up autocomplete, force prefix mapping zstyle ':completion:*' accept-exact '*(N)' zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path "${XDG_CACHE_HOME:-$HOME/.cache}/zshcompcache" +zstyle ':completion:*' cache-path "${XDG_CACHE_HOME:-$HOME/.cache}/zshcompcache" # shellcheck disable=SC2016 zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)*==34=34}:${(s.:.)LS_COLORS}")' diff --git a/zsh/.config/zsh/plugins.zsh b/zsh/.config/zsh/plugins.zsh index 6be2450..ff21c78 100644 --- a/zsh/.config/zsh/plugins.zsh +++ b/zsh/.config/zsh/plugins.zsh @@ -58,6 +58,8 @@ load_plugins() { zgen oh-my-zsh plugins/colored-man-pages + zgen load zsh-users/zsh-completions + # Load me last GENCOMPL_FPATH=${XDG_CONFIG_HOME:-"$HOME/.config/zsh"}/complete