Typing the same commands over and over again is frustrating. As a result, I created the following Zsh aliases (shortcuts) to save a few keystrokes when working with the terminal:
# Git
alias gs="git status"
alias gcm="git commit -m"
alias lm="git checkout main && git pull"
alias gp="git pull && git push"
alias ulc='git reset --soft HEAD~1'
alias gst="git stash"
alias pop="git stash pop"
alias gstapp="git stash apply"
# zsh
alias openzs="open ~/.zshrc"
alias sourcezs="source ~/.zshrc"
# Docker
alias dcb="docker compose build"
alias dcu="docker compose up -d"
alias dcd="docker compose down"
# npm
alias nrd="npm run dev"
alias nrb="npm run build"
alias ni="npm install"
alias nu="npm uninstall"
alias nr="npm run"
alias nrp="npm run prisma:studio"
# macOS
alias port="lsof -i"
alias stop="kill -9"
# Work
alias documenso="cursor ~/<my-folder>/Github/documenso"
alias documenso-repo="~/<my-folder>/Github/documenso"
# Bun
alias bx="bunx"
alias b="bun"
alias ba="bun add"
alias bi="bun install"
alias br="bun run"
alias bu="bun update"
alias bre="bun remove"
alias brd="bun run dev"
alias brb="bun run build"
alias bpm="bun pm"💡
If you want to go beyond aliases and improve your terminal further, check out my favorite zsh plugins.
By the way, this article shows how to improve your Mac terminal with oh-my-zsh.