dotfiles/zsh/.zshrc

55 lines
2.1 KiB
Bash

# ---- Version Managers ----
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# ---- Native Command Overwrites ----
/usr/bin/which -s nvim && alias vi="nvim" && alias vim="nvim" || echo "nvim not found, falling back to vi"
/usr/bin/which -s bat && alias cat="bat" || echo "bat not found, falling back to cat"
/usr/bin/which -s fd && alias find="fd -H" || echo "fd not found, falling back to find"
/usr/bin/which -s zoxide && alias cd="z" || echo "zoxide not found, falling back to cd"
/usr/bin/which -s eza && alias ls="eza --color=always --git --no-filesize --icons=always --no-time --no-user --no-permissions" || echo "eza not found, falling back to ls"
# ---- SSH Agent (1Password) ----
# https://developer.1password.com/docs/ssh/get-started/#step-3-turn-on-the-1password-ssh-agent
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
# ---- SSH Shortcuts ----
alias pandora="ssh root@pandora.cortex.io"
alias miranda="ssh root@miranda.cortex.io"
# ---- convenience commands ----
alias editShell="vi ~/.zshrc"
alias sourceShell="source ~/.zshrc"
export NOMAD_ADDR=http://pandora.cortex.io:4646
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
# ---- Oh-My-Posh ----
if [ "$TERM_PROGRAM" != "Apple_Terminal" ] && [ "$TERM_PROGRAM" != "zed" ];
then
eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/theme.toml)"
fi
# ---- Zoxide (better cd) ----
eval "$(zoxide init zsh)"
# ---- Homebrew ----
eval "$(/opt/homebrew/bin/brew shellenv)"
# ---- ZSH Plugins ----
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ---- Auto Enter TMUX ----
if [ -z "$TMUX" ] && [ "$TERM_PROGRAM" != "vscode" ] && [ "$TERM_PROGRAM" != "zed" ];
then
tmux attach -t TMUX || tmux new -s TMUX
fi