Skip to content

Commit

Permalink
omz
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Nov 14, 2024
1 parent 9ea9ca3 commit c5eaaf0
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 91 deletions.
24 changes: 0 additions & 24 deletions .zsh_plugins.txt

This file was deleted.

139 changes: 72 additions & 67 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
# shellcheck disable=2148,2034,2155,1091,2086,1094
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
[[ -d "$ZSH_CACHE_DIR/completions" ]] || mkdir -p "$ZSH_CACHE_DIR/completions"

# Ensure path arrays do not contain duplicates.
typeset -gU path fpath

# Additional PATHs
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="/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"
export XDG_CONFIG_HOME=${HOME}/.config

export ZSH="$HOME/.oh-my-zsh"
# ZSH_THEME="mosherussell"
ENABLE_CORRECTION="false"
COMPLETION_WAITING_DOTS="false"
DISABLE_UNTRACKED_FILES_DIRTY="true"
DISABLE_AUTO_UPDATE="true"
zstyle ':omz:update' mode reminder # just remind me to update when it's time
unset ZSH_AUTOSUGGEST_USE_ASYNC

# Set Locale
Expand All @@ -42,67 +32,81 @@ export LC_ALL=en_US.UTF-8
# History settings
HISTSIZE=5000
SAVEHIST=5000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing nonexistent history.
# setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt bang_hist # Treat the '!' character specially during expansion.
setopt extended_history # Write the history file in the ":start:elapsed;command" format.
setopt inc_append_history # Write to the history file immediately, not when the shell exits.
setopt share_history # Share history between all sessions.
setopt hist_expire_dups_first # Expire duplicate entries first when trimming history.
setopt hist_ignore_dups # Don't record an entry that was just recorded again.
setopt hist_ignore_all_dups # Delete old recorded entry if new entry is a duplicate.
setopt hist_find_no_dups # Do not display a line previously found.
setopt hist_save_no_dups # Don't write duplicate entries in the history file.
setopt hist_reduce_blanks # Remove superfluous blanks before recording entry.
setopt hist_verify # Don't execute immediately upon history expansion.
setopt hist_beep # Beep when accessing nonexistent history.

# ========= #
# Plugins #
# ========= #
plugins=(
argocd
asdf
autoupdate
aws
branch
colored-man-pages
command-not-found
common-aliases
docker
fzf
gh
git
git-auto-fetch
github
golang
helm
kube-ps1
kubectl
kubectx
terraform
zsh-autosuggestions
zsh-github-copilot
zsh-syntax-highlighting
)

# ============= #
# Autoloaders #
# Completions #
# ============= #
fpath+=($ZSH_CACHE_DIR/completions /opt/homebrew/share/zsh/site-functions)
source $HOME/.antidote/antidote.zsh
antidote load
source <(fzf --zsh)

autoload -U +X bashcompinit && bashcompinit

zsh-defer complete -o nospace -C terraform terraform
zsh-defer complete -o nospace -C terragrunt terragrunt
zsh-defer complete -C 'aws_completer' aws
[[ -f $ZSH_CACHE_DIR/completions/_docker ]] || docker completion zsh > $ZSH_CACHE_DIR/completions/_docker
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
fpath+=/opt/homebrew/share/zsh/site-functions

# ================ #
# PS1 and Random #
# ================ #
# fzf
# ============= #
# Autoloaders #
# ============= #
source $ZSH/oh-my-zsh.sh
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -l -g ""'
export FZF_DEFAULT_OPTS='--color fg:242,bg:236,hl:65,fg+:15,bg+:239,hl+:108 --color info:108,prompt:109,spinner:108,pointer:168,marker:168'
export FZF_CTRL_T_COMMAND='rg --color=never --files --hidden --follow -g "!.git"'
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers,changes {}"'

# ================ #
# PS1 and Random #
# ================ #
compdef terragrunt='terraform'
export EDITOR="nvim"
export AWS_PAGER=""

# zsh
export WORDCHARS=""
setopt menu_complete
unsetopt auto_menu
unsetopt case_glob
setopt glob_complete
setopt multios # enable redirect to multiple streams: echo >file1 >file2
setopt long_list_jobs # show long list format job notifications
setopt interactivecomments # recognize comments
zstyle ':completion:*:*:*:*:*' menu select

# asdf
eval "$(zoxide init --cmd cd zsh)"
export ASDF_PYTHON_DEFAULT_PACKAGES_FILE=~/Repos/dotfiles/requirements.txt
[[ -f ~/.asdf/plugins/golang/set-env.zsh ]] && {
source ~/.asdf/plugins/golang/set-env.zsh
asdf_update_golang_env
export PATH="$GOPATH/bin:$PATH"
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
}

# zsh gh copilot configuration
bindkey '^[|' zsh_gh_copilot_explain # bind Alt+shift+\ to explain
bindkey '^[\' zsh_gh_copilot_suggest # bind Alt+\ to suggest

Expand All @@ -117,6 +121,7 @@ fi
# ================ #
# Kubectl Contexts #
# ================ #

# Load all contexts
export KUBECONFIG=$HOME/.kube/config
export KUBECTL_EXTERNAL_DIFF="kdiff"
Expand Down

0 comments on commit c5eaaf0

Please sign in to comment.