From 9dd1f6819fc7d65bf461f47a41c402db1d8ec806 Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Wed, 30 Oct 2024 09:39:21 +0100 Subject: [PATCH] Improve compinit and plugins --- zsh.d/20-complete.zsh | 9 +++++---- zsh.d/90-plugins.zsh | 12 ++++++------ zshrc | 12 ++++++------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/zsh.d/20-complete.zsh b/zsh.d/20-complete.zsh index fcc790f..4bd9548 100644 --- a/zsh.d/20-complete.zsh +++ b/zsh.d/20-complete.zsh @@ -2,11 +2,12 @@ # Start autocomplete autoload -Uz compinit -if [[ -n "$HOME/.zcompdump(#qN.mh+24)" ]]; then +for dump in ~/.zcompdump(N.mh+24); do compinit -else - compinit -C -fi + touch ~/.zcompdump +done + +compinit -C autoload bashcompinit && bashcompinit diff --git a/zsh.d/90-plugins.zsh b/zsh.d/90-plugins.zsh index a1c979e..ff05eb9 100644 --- a/zsh.d/90-plugins.zsh +++ b/zsh.d/90-plugins.zsh @@ -1,17 +1,17 @@ # pyenv -if whence pyenv > /dev/null; then +if type pyenv > /dev/null; then export PYENV_ROOT="$HOME/.pyenv" # eval "$(pyenv init --path)" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" fi -# thefuck -whence thefuck > /dev/null && eval $(thefuck --alias) +# # thefuck +# type thefuck > /dev/null && eval $(thefuck --alias) # z # [ -f $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh ] && source $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh -if whence zoxide > /dev/null; then ## zoxide is installed +if type zoxide > /dev/null; then ## zoxide is installed eval "$(zoxide init zsh)" export Z_COMMAND=zoxide elif [ -f $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh ]; then ## zsh-z is installed @@ -24,10 +24,10 @@ fi # kubectl/krew export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" -if whence kubectl > /dev/null; then +if type kubectl > /dev/null; then alias k=kubectl alias kk='kubectl konfig merge ~/.kube/configs/* > ~/.kube/config' fi # Setup iTerm shell integration -test -e $HOME/.iterm2_shell_integration.zsh && source $HOME/.iterm2_shell_integration.zsh && export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=YES || echo "iTerm sh integration not installed" +#test -e $HOME/.iterm2_shell_integration.zsh && source $HOME/.iterm2_shell_integration.zsh && export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=YES || echo "iTerm sh integration not installed" diff --git a/zshrc b/zshrc index 9fdf3c0..9602615 100644 --- a/zshrc +++ b/zshrc @@ -20,12 +20,12 @@ [ -d ~/.zsh ] && BASE=~/.zsh function loadRC { - [ -d $1/zshfunctions ] && fpath=($1/zshfunctions $fpath) - [ -d $1/completions ] && fpath=($1/completions $fpath) + [ -d $1/zshfunctions ] && fpath=($1/zshfunctions $fpath) + [ -d $1/completions ] && fpath=($1/completions $fpath) - for zshFile in $1/[0-9]*.zsh; do - source $zshFile - done + for zshFile in $1/[0-9]*.zsh; do + source $zshFile + done } # Default PATH @@ -43,6 +43,6 @@ PATH="$PATH:$HOME/bin" # Add local customization file if [ -w $LIBRARY ]; then - [ -f $LIBRARY/99-local.zsh ] || echo "# Local customizations" > $LIBRARY/99-local.zsh + [ -f $LIBRARY/99-local.zsh ] || echo "# Local customizations" > $LIBRARY/99-local.zsh fi