Skip to content

.zshrc File Setup

Contents:

Initial Creation

If you don't have a .zshrc file in your home directory (~/.zshrc), create one:

touch .zshrc

.zshrc Template

Use the below template for a base version of your .zshrc file that contains needed exports and a couple alias' to help get started. Replace the github npm auth info with your github username and PAT once created.

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# dotnet exports
export DOTNET_ROOT="/usr/local/share/dotnet"
export PATH="/opt/homebrew/opt/dotnet@8/bin:$PATH"
export PATH=/opt/homebrew/bin:$PATH
export PATH="/usr/local/share/dotnet:$PATH"

# Github npm auth info
export GH_NPM_AUTH="{authToken}"
export GH_USERNAME="{username}"

# user bins
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"

# virtual env wrapper
export VIRTUALENVWRAPPER_PYTHON=/opt/homebrew/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/RiderProjects # Your default project dir
source /opt/homebrew/bin/virtualenvwrapper.sh

# ALL ALIASES
alias reload!="source ~/.zshrc"

# python alias
alias python="python3"
alias pip="pip3"

source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh