2022-11-21 20:06:11 -08:00
# shellcheck disable=SC1090,SC1091,SC2034,SC2154,SC2296
### Language / Fonts
export LANG="en_US"
export LC_ALL="en_US.UTF-8"
### Advanced Bash-features are supported
export BASH_SUPPORT=true
2022-11-22 07:30:02 -08:00
### Import Common Settings
2023-08-07 21:06:52 -07:00
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile.sh" ] || source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile.sh"
2022-11-21 20:06:11 -08:00
2023-07-11 21:32:13 -07:00
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
2022-11-21 20:06:11 -08:00
### Misc.
export HISTFILE="$XDG_STATE_HOME/zsh/history"
export ZLE_RPROMPT_INDENT=0
export WORDCHARS=${WORDCHARS//\/}
export PROMPT_EOL_MARK=
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
2023-07-30 22:31:48 -07:00
### .zcompdump
# Source: https://www.reddit.com/r/zsh/comments/nwxcg4/store_zcompdump_in_specific_directory/
export ZSH_COMPDUMP="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-$ZSH_VERSION"
2022-11-21 20:06:11 -08:00
### Antigen
2023-08-03 23:05:20 -07:00
export ADOTDIR="${XDG_DATA_HOME:-$HOME/.local/share}/antigen"
2022-11-21 20:06:11 -08:00
### Powerline
2023-08-03 23:05:20 -07:00
[[ ! -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] || source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
2022-11-21 20:06:11 -08:00
### Fig
2023-08-07 21:06:52 -07:00
[ ! -f "$HOME/.fig/shell/zshrc.pre.zsh" ] || source "$HOME/.fig/shell/zshrc.pre.zsh"
2022-11-21 20:06:11 -08:00
# --------------------------------- SETTINGS ----------------------------------
setopt AUTO_CD
setopt BEEP
2022-11-22 07:30:02 -08:00
setopt CORRECT
2022-11-21 20:06:11 -08:00
setopt HIST_BEEP
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY
setopt INTERACTIVE_COMMENTS
setopt MAGIC_EQUAL_SUBST
setopt NO_NO_MATCH
setopt NOTIFY
setopt NUMERIC_GLOB_SORT
setopt PROMPT_SUBST
setopt SHARE_HISTORY
# ZSH completion system
2023-08-07 21:06:52 -07:00
[ -d "${XDG_CACHE_HOME:-$HOME/.cache}/zsh" ] || mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/zsh"
2023-07-17 00:28:38 -07:00
2022-11-21 20:06:11 -08:00
zstyle ':completion:*:*:*:*:*' menu select
2022-11-21 20:09:14 -08:00
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
2022-11-21 20:06:11 -08:00
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' rehash true
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
# shellcheck disable=SC2016
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
2023-05-14 18:42:09 -07:00
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
if command -v fzf > /dev/null && command -v exa > /dev/null; then
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group ',' '.'
fi
2022-11-21 20:06:11 -08:00
# Key bindings
bindkey -e
bindkey '^U' backward-kill-line
bindkey '^[[2~' overwrite-mode
bindkey '^[[3~' delete-char
bindkey '^[[H' beginning-of-line
bindkey '^[[1~' beginning-of-line
bindkey '^[[F' end-of-line
bindkey '^[[4~' end-of-line
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
bindkey '^[[3;5~' kill-word
bindkey '^[[5~' beginning-of-buffer-or-history
bindkey '^[[6~' end-of-buffer-or-history
bindkey '^[[Z' undo
bindkey ' ' magic-space
# ------------------------------- ZSH PLUGINS ---------------------------------
# Plugin source helper
_source_plugin() {
local plugin_name="$1"
2023-08-03 23:05:20 -07:00
for basedir in "${XDG_DATA_HOME:-$HOME/.local/share}/antigen/bundles/zsh-users"; do
2022-11-21 20:06:11 -08:00
plugin="$basedir/$plugin_name/$plugin_name.zsh"
[ -f "$plugin" ] && source "$plugin" && return 0
done
echo "\033[33m[ ! ]\033[0m ZSH ${plugin_name#zsh-} not installed"
return 1
}
# ZSH Autosuggestions
_source_plugin zsh-autosuggestions && ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999'
# ZSH Syntax Highlighting
if _source_plugin zsh-syntax-highlighting; then
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
ZSH_HIGHLIGHT_STYLES[default]=none
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=white,underline
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=cyan,bold
ZSH_HIGHLIGHT_STYLES[suffix-alias]=fg=green,underline
ZSH_HIGHLIGHT_STYLES[global-alias]=fg=green,bold
ZSH_HIGHLIGHT_STYLES[precommand]=fg=green,underline
ZSH_HIGHLIGHT_STYLES[commandseparator]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[autodirectory]=fg=green,underline
ZSH_HIGHLIGHT_STYLES[path]=bold
ZSH_HIGHLIGHT_STYLES[path_pathseparator]=
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]=
ZSH_HIGHLIGHT_STYLES[globbing]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[command-substitution]=none
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[process-substitution]=none
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=green
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=green
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[rc-quote]=fg=magenta
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[assign]=none
ZSH_HIGHLIGHT_STYLES[redirection]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[comment]=fg=black,bold
ZSH_HIGHLIGHT_STYLES[named-fd]=none
ZSH_HIGHLIGHT_STYLES[numeric-fd]=none
ZSH_HIGHLIGHT_STYLES[arg0]=fg=cyan
ZSH_HIGHLIGHT_STYLES[bracket-error]=fg=red,bold
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=fg=blue,bold
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=fg=green,bold
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=fg=magenta,bold
ZSH_HIGHLIGHT_STYLES[bracket-level-4]=fg=yellow,bold
ZSH_HIGHLIGHT_STYLES[bracket-level-5]=fg=cyan,bold
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]=standout
fi
unset -f _source_plugin
# POWERLEVEL
if ! [[ $(tty) = /dev/tty* ]]; then
2023-08-03 23:05:20 -07:00
if source "${XDG_DATA_HOME:-$HOME/.local/share}/antigen/bundles/romkatv/powerlevel10k/powerlevel10k.zsh-theme" 2> /dev/null; then
2022-11-21 20:06:11 -08:00
s=' ' # fix too wide icons
POWERLEVEL9K_MODE=nerdfont-complete
POWERLEVEL9K_SHORTEN_STRATEGY=truncate_beginning
POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
2023-01-12 13:01:42 -08:00
# shellcheck disable=SC2016
2022-11-21 20:06:11 -08:00
POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT} $(whoami | grep -v "^root\$")'
POWERLEVEL9K_OS_ICON_BACKGROUND=red
POWERLEVEL9K_OS_ICON_FOREGROUND=white
POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND=black
POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND=red
POWERLEVEL9K_SSH_BACKGROUND=white
POWERLEVEL9K_SSH_FOREGROUND=blue
POWERLEVEL9K_FOLDER_ICON=
POWERLEVEL9K_DIR_BACKGROUND=blue
POWERLEVEL9K_DIR_FOREGROUND=black
POWERLEVEL9K_DIR_WRITABLE_BACKGROUND=black
POWERLEVEL9K_DIR_WRITABLE_FOREGROUND=red
POWERLEVEL9K_VCS_CLEAN_FOREGROUND=black
POWERLEVEL9K_VCS_CLEAN_BACKGROUND=green
POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=black
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=yellow
POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=white
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=black
POWERLEVEL9K_VCS_UNTRACKED_ICON=●
POWERLEVEL9K_VCS_UNSTAGED_ICON=±
POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=↓
POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=↑
POWERLEVEL9K_VCS_COMMIT_ICON=$s
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE=true
POWERLEVEL9K_EXECUTION_TIME_ICON=$s
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=black
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=blue
POWERLEVEL9K_COMMAND_BACKGROUND_JOBS_BACKGROUND=black
POWERLEVEL9K_COMMAND_BACKGROUND_JOBS_FOREGROUND=cyan
POWERLEVEL9K_TIME_ICON=
POWERLEVEL9K_TIME_FORMAT='%D{%I:%M}'
POWERLEVEL9K_TIME_BACKGROUND=black
POWERLEVEL9K_TIME_FOREGROUND=white
POWERLEVEL9K_RAM_ICON=
POWERLEVEL9K_RAM_FOREGROUND=black
POWERLEVEL9K_RAM_BACKGROUND=yellow
POWERLEVEL9K_VI_MODE_FOREGROUND=black
POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL
POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=green
POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL
POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=blue
POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE
POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=red
POWERLEVEL9K_VI_INSERT_MODE_STRING=
POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%F{blue}╭─'
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%F{blue}╰%f '
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon root_indicator ssh dir dir_writable vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vi_mode status command_execution_time background_jobs time ram)
unset s
else
echo '\033[33m[ ! ]\033[0m ZSH powerlevel10k not installed'
fi
else
clear
echo
echo
fi
switch_powerlevel_multiline_prompt(){
[ $POWERLEVEL9K_PROMPT_ON_NEWLINE = true ] \
&& POWERLEVEL9K_PROMPT_ON_NEWLINE=false \
|| POWERLEVEL9K_PROMPT_ON_NEWLINE=true
zle && zle accept-line
}
zle -N switch_powerlevel_multiline_prompt
bindkey ^P switch_powerlevel_multiline_prompt
# ----------------------------------- MISC -----------------------------------
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty)
precmd() {
print -Pnr -- $'\e]0;%n@%m: %~\a'
}
;;
esac
### Antigen
2023-08-07 21:06:52 -07:00
[ ! -f "$HOME/.local/scripts/antigen.zsh" ] || source "$HOME/.local/scripts/antigen.zsh"
2022-11-21 20:06:11 -08:00
if command -v antigen > /dev/null; then
2022-12-06 08:43:41 -08:00
# Fix for oh-my-zsh overriding exa aliases
export DISABLE_LS_COLORS=true
2023-05-14 17:41:51 -07:00
# Official Oh-My-ZSH plugins
2022-11-21 20:06:11 -08:00
antigen use oh-my-zsh
2023-01-12 10:50:06 -08:00
antigen bundle adb
2023-08-08 21:54:49 -07:00
# antigen bundle bazel # Unused
2022-12-01 20:53:42 -08:00
# antigen bundle colored-man-pages
2023-01-25 23:08:57 -08:00
antigen bundle command-not-found
antigen bundle copybuffer
# TODO: Add as an alias available to Bash as well
antigen bundle encode64
2023-06-13 23:15:05 -07:00
# antigen bundle fd # Added by bash completions scriptx``
# antigen bundle flutter /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/plugins/flutter/flutter.plugin.zsh:29: no such file or directory: /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/cache//completions/_flutter
2023-05-14 18:52:38 -07:00
# antigen bundle fzf # Added by bash completions script
# antigen bundle gcloud # Added by bash completions script
2023-05-14 17:41:51 -07:00
antigen bundle gem
2023-05-14 18:52:38 -07:00
# antigen bundle gh # Added by bash completions script
2023-01-25 23:08:57 -08:00
antigen bundle git-auto-fetch
2023-05-14 17:41:51 -07:00
antigen bundle git-extras
antigen bundle git-flow
antigen bundle gitfast
antigen bundle github
2022-12-01 20:53:42 -08:00
# antigen bundle gnu-utils
2023-05-14 17:41:51 -07:00
antigen bundle golang
# antigen bundle gpg-agent
2023-05-14 18:52:38 -07:00
# antigen bundle gradle # Added by bash completions script
# antigen bundle helm # Added by bash completions script
2023-05-14 17:41:51 -07:00
antigen bundle heroku
antigen bundle httpie
antigen bundle ionic
antigen bundle ipfs
antigen bundle isodate
2022-11-21 20:06:11 -08:00
# antigen bundle keychain
2023-05-14 17:41:51 -07:00
antigen bundle kn
2023-05-14 18:52:38 -07:00
# antigen bundle kubectl # Added by bash completions script
2023-01-25 23:08:57 -08:00
antigen bundle kubectx
2023-05-14 17:41:51 -07:00
antigen bundle last-working-dir
antigen bundle lxd
2023-01-25 23:08:57 -08:00
antigen bundle macos
2023-05-14 17:41:51 -07:00
antigen bundle macports
2023-01-25 23:08:57 -08:00
antigen bundle magic-enter
2023-05-14 17:41:51 -07:00
antigen bundle marktext
antigen bundle microk8s
2023-01-25 23:08:57 -08:00
antigen bundle minikube
2023-06-13 23:15:05 -07:00
# Received error so disabling mongo-atlas
# /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/plugins/mongo-atlas/mongo-atlas.plugin.zsh:14: no such file or directory: /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/cache//completions/atlas
# antigen bundle mongo-atlas
2023-05-14 17:41:51 -07:00
antigen bundle mongocli
antigen bundle mosh
antigen bundle multipass
2023-01-12 10:50:06 -08:00
antigen bundle ng
2023-05-14 17:41:51 -07:00
antigen bundle node-docs
2023-01-25 23:08:57 -08:00
antigen bundle nomad
2023-05-14 17:41:51 -07:00
antigen bundle oc
antigen bundle pass
# antigen bundle pep8
antigen bundle pip
# antigen bundle pipenv
antigen bundle pm2
antigen bundle qrcode
antigen bundle react-native
2023-01-25 23:08:57 -08:00
antigen bundle redis-cli
2023-01-12 10:50:06 -08:00
antigen bundle ripgrep
2023-06-13 23:15:05 -07:00
# Received error so disabling rust
# /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/plugins/rust/rust.plugin.zsh:22: no such file or directory: /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/cache//completions/_rustup
# /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/plugins/rust/rust.plugin.zsh:23: no such file or directory: /Users/bzalewski/.local/antigen/bundles/robbyrussell/oh-my-zsh/cache//completions/_cargo
# antigen bundle rust
2023-01-25 23:08:57 -08:00
antigen bundle safe-paste
2023-05-14 17:41:51 -07:00
antigen bundle sdk
# antigen bundle skaffold
antigen bundle spring
2022-11-21 20:06:11 -08:00
# antigen bundle shell-proxy
2023-06-13 21:02:47 -07:00
# On macOS, parse error 6/13/23 for sprunge
# antigen bundle sprunge
2022-11-21 20:06:11 -08:00
# antigen bundle ssh-agent
2023-01-12 10:50:06 -08:00
antigen bundle sudo
2023-05-14 18:42:09 -07:00
antigen bundle terraform
antigen bundle timer
antigen bundle tmuxinator
antigen bundle urltools
2023-01-25 23:08:57 -08:00
antigen bundle ufw
2023-05-14 18:42:09 -07:00
antigen bundle vagrant
2023-05-14 18:52:38 -07:00
# antigen bundle volta # Added by bash completions script
2023-01-25 23:08:57 -08:00
antigen bundle web-search
2023-05-14 18:52:38 -07:00
# antigen bundle wp-cli # Added by bash completions script
2023-01-25 23:08:57 -08:00
antigen bundle yarn
2022-11-21 20:06:11 -08:00
2023-06-17 13:01:27 -07:00
if [ ! -d /Applications ]; then
2023-06-18 20:30:41 -07:00
# Plugins that are troublesome on macOS due to Docker Desktop needing to launch
2023-06-17 13:01:27 -07:00
antigen bundle docker
antigen bundle docker-compose
fi
2023-05-14 17:41:51 -07:00
# Third-party plugins
2023-06-13 23:15:05 -07:00
# antigen bundle jscutlery/nx-completion Installing jscutlery/nx-completion... Error! Activate logging and try again.
2023-06-17 13:01:27 -07:00
# antigen bundle lukechilds/zsh-better-npm-completion
2023-05-14 17:41:51 -07:00
2023-01-25 23:08:57 -08:00
antigen bundle zsh-interactive-cd
2023-06-17 13:01:27 -07:00
antigen bundle zsh-navigation-tools
2022-11-21 20:06:11 -08:00
antigen bundle zsh-users/zsh-completions src
2023-08-07 21:06:52 -07:00
! command -v fzf > /dev/null || antigen bundle aloxaf/fzf-tab
2022-11-21 20:06:11 -08:00
antigen bundle marlonrichert/zsh-autocomplete@main
2023-05-14 18:42:09 -07:00
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
2023-08-07 21:06:52 -07:00
[ ! -d /Applications ] || antigen bundle zsh-apple-touchbar
2022-11-21 20:06:11 -08:00
antigen theme romkatv/powerlevel10k
antigen apply
fi
### ZSH Autocomplete
zstyle ':autocomplete:*' list-lines 14
zstyle ':autocomplete:history-search:*' list-lines 14
zstyle ':autocomplete:history-incremental-search-*:*' list-lines 14
2023-08-07 21:06:52 -07:00
! command -v fzf > /dev/null || zstyle ':autocomplete:*' fzf-completion yes
2022-11-21 20:06:11 -08:00
2023-07-17 00:28:38 -07:00
### Homebrew ZSH Completions
# Must be sourced before compinit / Oh-My-ZSH inclusion
2023-08-06 22:19:59 -07:00
export FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:$FPATH"
2023-08-07 21:06:52 -07:00
[ ! -d "$HOMEBREW_PREFIX/share/zsh-completions" ] || export FPATH="$HOMEBREW_PREFIX/share/zsh-completions:$FPATH"
[ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/zsh-completion" ] || export FPATH="${XDG_DATA_HOME:-$HOME/.local/share}/zsh-completion:$FPATH"
2023-07-17 00:28:38 -07:00
### ZSH compinit
2023-07-17 13:40:40 -07:00
autoload -Uz +X compinit && compinit -d "${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-$ZSH_VERSION"
2023-07-17 00:28:38 -07:00
### Bash Completions
autoload -U +X bashcompinit && bashcompinit
2023-08-07 21:06:52 -07:00
[ ! -f "/usr/local/etc/profile.d/bash_completion.sh" ] || source "/usr/local/etc/profile.d/bash_completion.sh"
2023-07-17 00:28:38 -07:00
2023-06-18 23:25:39 -07:00
### Atuin
2023-08-07 21:06:52 -07:00
! command -v atuin > /dev/null || eval "$(atuin init zsh)"
2023-06-18 23:25:39 -07:00
2023-08-06 22:19:59 -07:00
### Carapace
if command -v carapace > /dev/null; then
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands'
source <(carapace _carapace)
fi
2023-05-14 17:41:51 -07:00
### Cod
2023-08-07 21:06:52 -07:00
! command -v cod > /dev/null || source <(cod init $$ zsh)
2023-05-14 17:41:51 -07:00
2022-11-21 20:06:11 -08:00
### direnv
2023-08-07 21:06:52 -07:00
! command -v direnv > /dev/null || eval "$(direnv hook zsh)"
2022-11-21 20:06:11 -08:00
2023-05-31 22:55:48 -07:00
### Emplace
2023-06-09 14:59:45 -07:00
# Error tracking: https://github.com/tversteeg/emplace/issues/375
2023-08-07 21:06:52 -07:00
# ! command -v emplace > /dev/null || eval "$(emplace init zsh)"
2023-05-31 22:55:48 -07:00
2023-06-04 00:46:31 -07:00
### Google Cloud SDK
2023-08-07 21:06:52 -07:00
[ ! -f "$HOMEBREW_PREFIX/share/google-cloud-sdk/path.zsh.inc" ] || source "$HOMEBREW_PREFIX/share/google-cloud-sdk/path.zsh.inc"
[ ! -f "$HOMEBREW_PREFIX/share/google-cloud-sdk/completion.zsh.inc" ] || source "$HOMEBREW_PREFIX/share/google-cloud-sdk/completion.zsh.inc"
2023-06-04 00:46:31 -07:00
2023-08-06 22:19:59 -07:00
### hiSHtory
2023-08-07 21:06:52 -07:00
export PATH="$PATH:${XDG_CONFIG_HOME:-$HOME/.config}/hishtory"
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.zsh" ] || source "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.zsh"
2023-08-06 22:19:59 -07:00
### Hoard
if command -v hoard > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.zsh" ]; then
2023-08-07 21:06:52 -07:00
source "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.zsh"
2023-08-06 22:19:59 -07:00
fi
2023-06-24 00:54:01 -07:00
### iTerm2
2023-08-07 22:29:21 -07:00
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.zsh" ] || source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.zsh"
2023-06-24 00:54:01 -07:00
2022-11-21 20:06:11 -08:00
### Java (asdf)
2023-08-07 21:06:52 -07:00
[ ! -f "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh" ] || source "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh"
2022-11-21 20:06:11 -08:00
2023-06-04 23:34:59 -07:00
### Navi (Ctrl+G)
2023-08-07 21:06:52 -07:00
! command -v navi > /dev/null || eval "$(navi widget zsh)"
2023-06-04 23:34:59 -07:00
2022-11-21 20:06:11 -08:00
### Fig
2023-08-07 21:06:52 -07:00
[ ! -f "$HOME/.fig/shell/zshrc.post.zsh" ] || source "$HOME/.fig/shell/zshrc.post.zsh"
2022-11-21 20:06:11 -08:00
2023-11-07 01:30:08 -08:00
### pkgx
! command -v pkgx > /dev/null || source <(pkgx --shellcode)
2022-11-21 20:06:11 -08:00
### Powerline
2023-08-08 21:54:49 -07:00
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/p10k.zsh" ] || source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/p10k.zsh"
2022-11-21 20:06:11 -08:00
2023-08-01 20:04:10 -07:00
### SDKMan
if command -v brew > /dev/null && command -v sdkman-cli > /dev/null; then
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
. "$SDKMAN_DIR/bin/sdkman-init.sh"
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
2023-08-07 22:29:21 -07:00
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
2023-08-01 20:04:10 -07:00
. "$SDKMAN_DIR/bin/sdkman-init.sh"
fi
2023-08-08 21:54:49 -07:00
### Sheldon
2023-08-17 20:46:45 -07:00
export SHELDON_CONFIG_FILE="${SHELDON_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/sheldon}/plugins.zsh.toml"
2023-08-08 22:46:26 -07:00
! command -v sheldon > /dev/null || eval "$(command sheldon source)"
2023-08-08 21:54:49 -07:00
2023-08-06 22:19:59 -07:00
### Up
2023-08-07 21:06:52 -07:00
[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ] || source "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh"
2023-05-14 18:42:09 -07:00
2022-11-21 20:06:11 -08:00
### HashiCorp Vault
2023-08-07 21:06:52 -07:00
! command -v vault > /dev/null || complete -o nospace -C vault vault
2023-01-12 10:50:06 -08:00
### zoxide
if command -v zoxide > /dev/null; then
2023-07-07 01:29:58 -07:00
zstyle ':autocomplete:recent-dirs' backend zoxide
2023-08-06 22:19:59 -07:00
eval "$(zoxide init zsh)"
2023-08-03 23:05:20 -07:00
else
alias z='cd'
2023-01-12 10:50:06 -08:00
fi