# shuck: disable=C005 # zsh/zinit.zsh # Order of execution of related Ice-mods: atinit -> atpull! -> make'!!' -> mv # -> cp -> make! -> atclone/atpull -> make -> (plugin script loading) -> src # -> multisrc -> atload. export DKO_SOURCE="${DKO_SOURCE} -> zinit.zsh {" function { local man1="${ZINIT[MAN_DIR]}/man1" zinit lucid as"program" from"gh-r" \ atclone'./direnv hook zsh > zhook.zsh' \ atpull'%atclone' \ mv"direnv* -> direnv" \ pick"direnv" \ src="zhook.zsh" \ for direnv/direnv # ---------------------------------------------------------------------------- # Git # ---------------------------------------------------------------------------- zinit lucid as'program' for \ pick"${ZPFX}/bin/git-*" \ src'etc/git-extras-completion.zsh' \ make"PREFIX=${ZPFX} SKIP_CONFLICT_CHECK=yes" \ 'tj/git-extras' \ ; # ---------------------------------------------------------------------------- # Utilities # ---------------------------------------------------------------------------- # my fork of cdbk, ZSH hash based directory bookmarking. No wait! export ZSH_BOOKMARKS="${HOME}/.local/zshbookmarks" zinit lucid light-mode for 'davidosomething/cdbk' export _ZO_DATA="${XDG_DATA_HOME}/zoxide" # Customized from instructions at https://github.com/sharkdp/bat#man zinit lucid from'gh-r' as'program' for \ atload'eval "$(zoxide init --cmd j zsh)"' \ pick'zoxide/zoxide' \ 'ajeetdsouza/zoxide' \ ; zinit snippet 'OMZP::cp' zinit snippet 'OMZP::extract' if [[ -d "$ASDF_DATA_DIR" ]]; then __dko_warn "ASDF_DATA_DIR found, please migrate to mise" fi # ---------------------------------------------------------------------------- # Completions # ---------------------------------------------------------------------------- # In-line best history match suggestion # don't suggest lines longer than export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=78 # as of v4.0 use ZSH/zpty module to async retrieve export ZSH_AUTOSUGGEST_USE_ASYNC=1 # Removed forward-char export ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=(vi-end-of-line) export ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=(forward-word vi-forward-word) export ZSH_AUTOSUGGEST_STRATEGY=(history completion) #export ZSH_AUTOSUGGEST_MANUAL_REBIND=1 zinit lucid wait for \ atload'_zsh_autosuggest_start && bindkey "^n" autosuggest-accept' \ 'zsh-users/zsh-autosuggestions' [[ -n $HOMEBREW_PREFIX ]] && zinit \ id-as'homebrew-completions' \ wait as'completion' lucid nocompile run-atpull \ atclone'print Installing brew provided completions...; mkdir -p $ZPFX/funs; local -a _brewcomps=( $HOMEBREW_PREFIX/share/zsh/site-functions/^_*(N.) ); (( $#_brewcomps )) && command cp $_brewcomps $ZPFX/funs; zinit creinstall -q $HOMEBREW_PREFIX/share/zsh/site-functions;' \ atload'fpath=( ${(u)fpath[@]:#$ZPFX/share/zsh/*} ); fpath+=( $ZPFX/funs );' \ atpull'%atclone' \ for @zdharma-continuum/null zinit lucid wait for \ blockf atpull'zinit creinstall -q .' \ 'zsh-users/zsh-completions' # ---------------------------------------------------------------------------- # Syntax last # autoload and run compinit # ---------------------------------------------------------------------------- # don't add wait, messes with zsh-autosuggest # zinit lucid atload"zicompinit; zicdreplay" for \ # 'zdharma/fast-syntax-highlighting' zinit ice as"program" from"gh-r" ver"1.9.0" \ pick"zsh-patina-*/zsh-patina" \ atload'eval "$(zsh-patina activate)"' zinit light michel-kraemer/zsh-patina # ---------------------------------------------------------------------------- # mise - must load after other PATH-modifying plugins (e.g. patina) # so that mise shims take precedence # ---------------------------------------------------------------------------- local mise_bpick="" [[ $DOTFILES_OS == "Linux" ]] && mise_bpick="*-linux-x64.tar.gz" [[ $DOTFILES_OS == "Darwin" ]] && { mise_bpick="*-macos-x64.tar.gz" [[ $DOTFILES_DISTRO == "arm64" ]] && mise_bpick="*-macos-arm64.tar.gz" } # no lucid zinit ice from'gh-r' as'program' bpick"$mise_bpick" \ pick'mise/bin/mise' \ atclone" cp -vf **/*.1 \"$man1\"; ./mise/bin/mise completion zsh > _mise; " \ atpull'%atclone' \ atload'eval "$(mise activate zsh)"' zinit light 'jdx/mise' # completion that wants compinit zinit ice atload"zicompinit; zicdreplay; zpcdreplay" \ atclone"./zplug.zsh" atpull"%atclone" zinit light g-plane/pnpm-shell-completion } DKO_SOURCE="${DKO_SOURCE} }"