################################################################################ # ZSH Configuration # # Note: in order for files in `~/.config` to be picked up, be sure to set the # global `XDG_*` and `ZDOTDIR` paths. On macOS, these are set at `/etc/zshenv` # or `~/.zshenv`), and look something like the following block: # # ```zsh # export XDG_CONFIG_HOME=$HOME/.config # export XDG_CACHE_HOME=$HOME/.cache # export XDG_DATA_HOME=$HOME/.local/share # export XDG_STATE_HOME=$HOME/.local/state # export XDG_RUNTIME_DIR=$HOME/.run # export XDG_DATA_DIRS=/usr/local/share:/usr/share # export XDG_CONFIG_DIRS=/etc/xdg # export ZDOTDIR=$XDG_CONFIG_HOME/zsh # if [ -f $ZDOTDIR/.zshenv ]; then source $ZDOTDIR/.zshenv; fi # ``` # ################################################################################ ################################################################################ # Disable /etc/zprofile, /etc/zshrc, /etc/zlogin and /etc/zlogout ################################################################################ unsetopt GLOBAL_RCS ################################################################################ # $PATH and similar ################################################################################ PATH="/bin:/sbin" PATH="${PATH}:/usr/local/bin" PATH="${PATH}:/opt/homebrew/sbin" PATH="${PATH}:/opt/homebrew/bin" PATH="${PATH}:/usr/bin" PATH="${PATH}:/usr/sbin" # Additional Homebrew items that aren't linked by default PATH="${PATH}:/opt/homebrew/opt/ruby/bin" PATH="${PATH}:/opt/homebrew/opt/libpq/bin" PATH="${PATH}:${HOME}/.scripts" export GOPATH="${HOME}/.go" PATH="${PATH}:${GOPATH}/bin" PATH="${PATH}:${HOME}/.gem/bin" PATH="${PATH}:${HOME}/.cargo/bin" PATH="${PATH}:${HOME}/.poetry/bin" PATH="${PATH}:${HOME}/.rvm/bin" # Run `path_helper`, and make its entries appear last, to preserve path ordering if [ -x /usr/libexec/path_helper ]; then oldpath="${PATH}" eval `/usr/libexec/path_helper -s` PATH="${oldpath}:${PATH}" fi # Remove duplicate entries typeset -U PATH export PATH ################################################################################ # Miscellaneous configuration options ################################################################################ export HOMEBREW_NO_ANALYTICS=1 ################################################################################ # Color palette and dark mode ################################################################################ source $XDG_CONFIG_HOME/jonathandarker/palette.sh export LIGHTMODE_TOGGLE_FLAG_FILE="$XDG_RUNTIME_DIR/lightmode.toggled.flag" if [ -f $LIGHTMODE_TOGGLE_FLAG_FILE ]; then export JONATHANDARKER_COLOR_BG="$JONATHANDARKER_COLOR_15" export JONATHANDARKER_COLOR_BA="$JONATHANDARKER_COLOR_07" export JONATHANDARKER_COLOR_FG="$JONATHANDARKER_COLOR_00" export JONATHANDARKER_COLOR_FA="$JONATHANDARKER_COLOR_08" fi ################################################################################ # Ports ################################################################################ export SURFINGKEYS_SETTINGS_SERVER_PORT="21212" ################################################################################ # Aliases ################################################################################ alias n="nvim" alias lg="lazygit" alias ld="lazydocker" # git alias g="git" alias gs="git s" alias gl="git l" # ls alias ls="lsd -a" alias la="lsd -la" # clear alias c="clear && NEW_LINE_BEFORE_PROMPT=0" alias clear="clear && NEW_LINE_BEFORE_PROMPT=0" #python alias python="python3" alias py="python3" #granted alias assume=". assume" #brew alias brewdump="(cd $XDG_CONFIG_HOME/brew/ && brew bundle dump --force --describe)" ################################################################################ # nvm # Lazy-loaded, using logic from https://github.com/undg/zsh-nvm-lazy-load ################################################################################ export NVM_DIR="$HOME/.nvm" load-nvm() { [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" } nvm() { unset -f nvm; load-nvm; nvm "$@" } node() { unset -f node; load-nvm; node "$@"; } npm() { unset -f npm; load-nvm; npm "$@"; } pnpm() { unset -f pnpm; load-nvm; pnpm "$@"; } yarn() { unset -f yarn; load-nvm; yarn "$@"; } ################################################################################ # Private or system-specific environment variables ################################################################################ if [ -f $ZDOTDIR/.zshenv.private ]; then source $ZDOTDIR/.zshenv.private fi