From 54839e05571b09458b40f0ce9e2160a47cdeb51f Mon Sep 17 00:00:00 2001 From: Moshe Avni Date: Mon, 11 Nov 2024 11:03:44 +0200 Subject: [PATCH] zsh wip --- .zsh_plugins.txt | 19 +++++++++++-------- .zshrc | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/.zsh_plugins.txt b/.zsh_plugins.txt index 5547263d..eb5e72b5 100644 --- a/.zsh_plugins.txt +++ b/.zsh_plugins.txt @@ -1,18 +1,17 @@ mattmc3/ez-compinit + +# completions zsh-users/zsh-completions kind:fpath path:src -belak/zsh-utils path:completion/functions kind:autoload post:compstyle_zshzoo_setup loiccoyle/zsh-github-copilot -ohmyzsh/ohmyzsh path:plugins/aliases +ohmyzsh/ohmyzsh path:plugins/asdf kind:defer ohmyzsh/ohmyzsh path:plugins/argocd -ohmyzsh/ohmyzsh path:plugins/asdf ohmyzsh/ohmyzsh path:plugins/aws ohmyzsh/ohmyzsh path:plugins/branch ohmyzsh/ohmyzsh path:plugins/colored-man-pages ohmyzsh/ohmyzsh path:plugins/command-not-found ohmyzsh/ohmyzsh path:plugins/common-aliases ohmyzsh/ohmyzsh path:plugins/copybuffer -ohmyzsh/ohmyzsh path:plugins/dircycle ohmyzsh/ohmyzsh path:plugins/fzf ohmyzsh/ohmyzsh path:plugins/git ohmyzsh/ohmyzsh path:plugins/git-auto-fetch @@ -21,8 +20,12 @@ ohmyzsh/ohmyzsh path:plugins/golang ohmyzsh/ohmyzsh path:plugins/kube-ps1 ohmyzsh/ohmyzsh path:plugins/kubectl ohmyzsh/ohmyzsh path:plugins/kubectx -ohmyzsh/ohmyzsh path:plugins/terraform ohmyzsh/ohmyzsh path:plugins/urltools -zsh-users/zsh-autosuggestions -zsh-users/zsh-history-substring-search -zdharma-continuum/fast-syntax-highlighting +zsh-users/zsh-autosuggestions kind:defer +zsh-users/zsh-history-substring-search kind:defer +zsh-users/zsh-syntax-highlighting kind:defer + +# this is last +belak/zsh-utils path:completion +ohmyzsh/ohmyzsh path:plugins/terraform kind:fpath +ohmyzsh/ohmyzsh path:plugins/docker/completions kind:fpath diff --git a/.zshrc b/.zshrc index c2b08151..d7a65be1 100644 --- a/.zshrc +++ b/.zshrc @@ -4,19 +4,35 @@ zmodload zsh/zprof # Basic ZSH Config # # ================ # +[[ -n "$ZSH" ]] || export ZSH="${${(%):-%x}:a:h}" +[[ -n "$ZSH_CUSTOM" ]] || ZSH_CUSTOM="$ZSH/custom" +[[ -n "$ZSH_CACHE_DIR" ]] || ZSH_CACHE_DIR="$ZSH/cache" +if [[ ! -w "$ZSH_CACHE_DIR" ]]; then + ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/antidote" +fi +mkdir -p "$ZSH_CACHE_DIR/completions" + # Ensure path arrays do not contain duplicates. typeset -gU path fpath # Additional PATHs -export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH" -export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" -export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" -export PATH="/usr/local/opt/curl/bin:$PATH" -export PATH="/usr/local/opt/ruby/bin:$PATH" -export PATH="$HOME/.bin:$HOME/.local/bin:$PATH" -export PATH="$HOME/.cargo/bin:${PATH}" -export PATH="/usr/local/sbin:$PATH" -export PATH="/usr/local/opt/postgresql@15/bin:$PATH" +path=( + /opt/homebrew/bin + /opt/homebrew/sbin + /opt/homebrew/opt/make/libexec/gnubin + ${KREW_ROOT:-$HOME/.krew}/bin + /usr/local/opt/curl/bin + /usr/local/opt/ruby/bin + $HOME/.bin + $HOME/.local/bin + $HOME/.cargo/bin + /usr/local/sbin + /usr/local/opt/postgresql@15/bin + $path +) + +# Export PATH +export PATH export XDG_CONFIG_HOME=${HOME}/.config unset ZSH_AUTOSUGGEST_USE_ASYNC @@ -47,6 +63,7 @@ setopt HIST_BEEP # Beep when accessing nonexistent history. # ============= # # Autoloaders # # ============= # +fpath+=($ZSH_CACHE_DIR/completions) source $HOME/.antidote/antidote.zsh antidote load export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -l -g ""' @@ -57,15 +74,18 @@ export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers,changes {} # ================ # # PS1 and Random # # ================ # -complete -o nospace -C terragrunt -C terraform terragrunt +# complete -o nospace -C terragrunt -C terraform terragrunt test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" export EDITOR="nvim" export AWS_PAGER="" +export WORDCHARS="" setopt MENU_COMPLETE unsetopt AUTO_MENU unsetopt CASE_GLOB setopt GLOB_COMPLETE eval "$(zoxide init --cmd cd zsh)" + +# ASDF export ASDF_PYTHON_DEFAULT_PACKAGES_FILE=~/Repos/dotfiles/requirements.txt [[ -f ~/.asdf/plugins/golang/set-env.zsh ]] && { source ~/.asdf/plugins/golang/set-env.zsh