Zsh completions changes

This commit is contained in:
Mateusz Słodkowicz 2026-06-10 11:36:26 +02:00
parent 5f753f2050
commit c159b6dfdd
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
3 changed files with 17 additions and 7 deletions

View File

@ -140,12 +140,11 @@ function __zsh_compl () {
# Some functions, like _apt and _dpkg, are very slow. We can use a cache in
# order to speed things up
if [[ ${__COMP_CACHING:-yes} == yes ]]; then
__COMP_CACHE_DIR=${__COMP_CACHE_DIR:-${ZDOTDIR:-$HOME}/.cache}
if [[ ! -d ${__COMP_CACHE_DIR} ]]; then
command mkdir -p "${__COMP_CACHE_DIR}"
if [[ ! -d ${ZSH_COMPDIR} ]]; then
command mkdir -p "${ZSH_COMPDIR}"
fi
zstyle ':completion:*' use-cache yes
zstyle ':completion:*:complete:*' cache-path "${__COMP_CACHE_DIR}"
zstyle ':completion:*:complete:*' cache-path "${ZSH_COMPDIR}"
fi
# host completion

View File

@ -1 +1,7 @@
#MSYS
if [[ "$(uname -s)" =~ ^MSYS_NT.* ]]; then
export MSYS=winsymlinks:nativestrict
fi
__MATERUS_HM_ZSH=1

View File

@ -24,8 +24,6 @@ fi
[ -d $ZSH_DATA_DIR/plugins/zsh-autosuggestions ] || git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_DATA_DIR/plugins/zsh-autosuggestions
source ${ZSH_DATA_DIR}/plugins/powerlevel10k/powerlevel10k.zsh-theme
source ${ZSH_CONFIG_DIR}/extra/zinputrc
source ${ZSH_CONFIG_DIR}/extra/zshcompletion.zsh
source ${ZSH_DATA_DIR}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ${ZSH_DATA_DIR}/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
@ -73,6 +71,8 @@ fi
#region Bindings
source ${ZSH_CONFIG_DIR}/extra/zinputrc
bindkey -r "^["
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
@ -85,8 +85,13 @@ bindkey '^[[3;2~' delete-word
#endregion
#region Completions
ZSH_COMPDUMP="${ZSH_COMPDUMP:-${XDG_CACHE_HOME:-${HOME}/.cache}/.zcompdump-${HOST}-${ZSH_VERSION}}"
ZSH_COMPDIR="${ZSH_COMPDIR:-${XDG_CACHE_HOME:-${HOME}/.cache}/zsh}"
ZSH_COMPDUMP="${ZSH_COMPDUMP:-${ZSH_COMPDIR}/.zcompdump-${HOST}-${ZSH_VERSION}}"
if [[ ! -d ${ZSH_COMPDIR} ]]; then
command mkdir -p "${ZSH_COMPDIR}"
fi
autoload -U compinit && compinit -d $ZSH_COMPDUMP
source ${ZSH_CONFIG_DIR}/extra/zshcompletion.zsh
#endregion
#region Functions