dotfiles/.zshrc

61 lines
1.8 KiB
Bash
Raw Normal View History

2024-10-21 08:50:44 -05:00
system_type=$(uname -s)
2024-10-17 17:28:50 -05:00
# shell options
2024-10-29 17:03:47 -05:00
setopt auto_cd append_history share_history histignorealldups
2024-10-17 17:28:50 -05:00
# aliases
2024-10-29 17:03:47 -05:00
get_ls_command() {
command -v lsd &>/dev/null
if [ $? -eq 0 ]; then
echo "lsd"
else
echo "ls"
fi
}
alias ls="$(get_ls_command) -F"
# git aliases
alias g=git
alias gi=git
2024-10-21 08:50:44 -05:00
# Homebrew aliases
2024-10-29 17:03:47 -05:00
alias b="brew"
2024-10-21 08:50:44 -05:00
alias bv="brew-visit" # points to the function below because I'm complicated
2024-10-17 17:28:50 -05:00
alias bi="brew info"
alias bs="brew search"
2024-10-21 08:50:44 -05:00
2024-10-29 17:03:47 -05:00
# YADM aliases
alias y="yadm"
alias ys="yadm status"
2024-10-21 08:50:44 -05:00
# These depend on some installed packages, so just to be safe
2024-10-17 17:28:50 -05:00
[[ "$(command -v bat)" ]] && alias cat="bat"
[[ "$(command -v htop)" ]] && alias top="htop"
# environment variables
2024-10-29 17:03:47 -05:00
export PATH="$PATH:${HOME}/.local/bin"
2024-10-17 17:28:50 -05:00
export CLICOLOR=1
# export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/opt/homebrew/share/zsh-syntax-highlighting/highlighters
2024-10-29 17:03:47 -05:00
# Load functions
fpath=("$HOME/.functions" "${fpath[@]}")
autoload -Uz ql f brew-visit tre compinit && compinit
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-17 17:28:50 -05:00
[ -f ~/.config/op/plugins.sh ] && source ~/.config/op/plugins.sh
[ -f /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -f /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
2024-10-21 08:50:44 -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
[ -f /opt/homebrew/share/liquidprompt ] && source /opt/homebrew/share/liquidprompt
2024-10-17 17:28:50 -05:00
[ -e "${HOME}/.iterm2_shell_integration.zsh" ] && source "${HOME}/.iterm2_shell_integration.zsh"
2024-10-29 17:03:47 -05:00
if it2check; then
2024-10-21 08:50:44 -05:00
iterm2_print_user_vars() {
it2git
}
fi
eval "$(zoxide init --cmd j zsh)"
eval $(thefuck --alias)
# eval "$(starship init zsh)"