dotfiles/.zshrc

93 lines
1.8 KiB
Bash
Raw Normal View History

2024-10-21 08:50:44 -05:00
system_type=$(uname -s)
2024-10-29 22:57:09 -05:00
# Shell options
OPTIONS=(
auto_cd
append_history
share_history
histignorealldups
## Gonna slowly turn these on and see what I like
2024-10-29 17:03:47 -05:00
2024-10-29 22:57:09 -05:00
# auto_list
# auto_menu
# auto_pushd
# completeinword
# correct
# extended_history
# histexpiredupsfirst
# histignoredups
# histignorespace
# histverify # this one can get annoying...
# interactivecomments
# listpacked
# longlistjobs
# nocaseglob
# noflowcontrol
# promptsubst
# pushdignoredups
# pushdminus
)
2024-10-21 08:50:44 -05:00
2024-10-29 22:57:09 -05:00
setopt $OPTIONS[@]
2024-10-21 08:50:44 -05:00
2024-10-29 22:57:09 -05:00
fpath+=($HOME/.config/zsh/functions)
2024-10-29 17:03:47 -05:00
2024-10-30 09:37:25 -05:00
CONFIG_DIR=$HOME/.config
ZSH_CONFIG_DIR=$CONFIG_DIR/zsh
2024-10-29 22:57:09 -05:00
FILES_TO_SOURCE=(
2024-10-30 09:37:25 -05:00
$ZSH_CONFIG_DIR/aliases
$ZSH_CONFIG_DIR/environment
$ZSH_CONFIG_DIR/zsh-unplugged # extremely minimal "package manager"
2024-10-29 22:57:09 -05:00
$HOME/.iterm2_shell_integration.zsh
$HOMEBREW_PREFIX/opt/nvm/nvm.sh
$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm
)
for file in "${FILES_TO_SOURCE[@]}"; do
if [ -s $file ]; then
source "$file"
else
echo "WARNING: $file is empty or does not exist."
fi
done
2024-10-17 17:28:50 -05:00
2024-10-29 17:03:47 -05:00
# Load functions
2024-10-30 09:37:25 -05:00
fpath+=("$ZSH_CONFIG_DIR/functions")
2024-10-29 22:57:09 -05:00
FUNCS_TO_AUTOLOAD=(
brew-visit
f
fshow
ql
show-fpath
take
tre
touchp
unbuff
promptinit
compinit
)
autoload -Uz $FUNCS_TO_AUTOLOAD && compinit && promptinit
prompt pure
2024-10-17 17:28:50 -05:00
2024-10-29 17:03:47 -05:00
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh && source <(fzf --zsh)
2024-10-29 22:57:09 -05:00
if [ "$system_type" = "Darwin" ]; then
2024-10-30 09:27:56 -05:00
[ -f $HOME/.config/op/plugins.sh ] && source ~/.config/op/plugins.sh
[ -e $HOME/.iterm2_shell_integration.zsh ] && source $HOME/.iterm2_shell_integration.zsh
2024-10-29 22:57:09 -05:00
[ -f /opt/homebrew/opt/git-extras/share/git-extras/git-extras-completion.zsh ] && source /opt/homebrew/opt/git-extras/share/git-extras/git-extras-completion.zsh
fi
$HOME/.iterm2/it2check
export TERMINAL_IS_ITERM2=$?
if [ $TERMINAL_IS_ITERM2 -eq 0 ]; then
2024-10-21 08:50:44 -05:00
iterm2_print_user_vars() {
it2git
}
fi
eval "$(zoxide init --cmd j zsh)"
eval $(thefuck --alias)