My Handy Zsh Aliases for Lightning Fast Workflows
A complete breakdown of my `.zshrc` file, including custom git functions, quick navigation aliases, and safer shell commands.
Typing the same commands again and again gets old real fast. Here are all the aliases and functions from my actual .zshrc that make dev work significantly quicker.
1. The Basics
Git Essentials
I map all my daily Git actions to 2-3 keystrokes to stay in flow.
alias gst='git status'alias ga='git add .'alias gc='git commit -m'alias gp='git push'alias gl='git pull'alias gco='git checkout'alias lg='lazygit'
Modern CLI Replacements
I completely replace ls and cat with their Rust-based modern equivalents (eza and bat).
alias ls='eza --icons'alias ll='eza -la --icons --git'alias lt='eza --tree --icons --level=2'alias lta='eza --tree --icons --level=3 --all'alias cat='bat'
Package Management (Bun)
Bun is insanely fast, and abbreviating its commands saves even more time.
alias bi='bun install'alias ba='bun add'alias br='bun remove'alias dev='bun run dev'alias build='bun run build'
2. Custom Functions
Parallel Features
For branching and isolated environments, I use git worktrees instead of checking out branches directly. This script automates it:
wt() {local branch="$1"local dir="../$(basename "$PWD")__\${branch//\//-}"git worktree add -b "$branch" "$dir" && cd "$dir"}
Usage is simple: wt feature/auth creates a new directory adjacent to the current one, linked to a new branch, and drops you into it.
3. Navigation & Safety
Fast Traversal
Instead of spamming cd .., I use these to quickly jump up directories.
alias ..='cd ..'alias ...='cd ../..'alias ....='cd ../../..'alias c='clear'
Safety Nets
Adding the -i flag ensures the shell will prompt me before destroying files by mistake.
alias rm='rm -i'alias cp='cp -i'alias mv='mv -i'
4. Docker Shortcuts
Container Management
Nobody wants to type docker compose down -v every time. These abbreviations save massive amounts of keystrokes over a year.
alias dcu="docker compose up -d"alias dcd="docker compose down"alias dcr="docker compose restart"alias dcl="docker compose logs -f"
Drop these into your config and enjoy the speed boost!
Ship fast, stay sharp.