Skip to main content

Overview

Shell aliases are defined across multiple files in system/zsh/:
  • aliases.zsh - General aliases and utilities
  • git.zsh - Git-specific aliases and functions
  • pacman.zsh - Package manager aliases
  • functions.zsh - Custom shell functions
Modern file listing using eza (modern ls replacement).
AliasCommandDescription
lseza -a --icons=always --group-directories-firstList all files with icons
lleza -al --icons=always --group-directories-first --gitLong list with git status
lteza -a --tree --level=2 --icons=always --group-directories-firstTree view (2 levels)
leza -1 --icons=always --group-directories-firstSingle column list
lneweza -al --sort=modified --icons=alwaysSort by modification time
ldireza -aD --icons=alwaysList directories only
lsdeza -d */ --icons=alwaysList subdirectories
treeeza --tree --icons=always --group-directories-firstTree view (all levels)
treeaeza -al --tree --icons --git-ignoreTree with git-ignore

ZSH Configuration

AliasCommandDescription
reloadexec zshReload ZSH configuration
zcg$EDITOR $ZDOTDIR/.zshrcEdit .zshrc
zshplugins$EDITOR $ZDOTDIR/.zsh_plugins.txtEdit plugin list

System & File Operations

Basic Commands

AliasCommandDescription
clclearClear terminal
qexitExit shell
fffastfetchDisplay system info
shutdownsystemctl poweroffPower off system
rebootsystemctl rebootReboot system
suspendsystemctl suspendSuspend system
rootsudo suSwitch to root user

Safe File Operations

Confirmation prompts for destructive operations.
AliasCommandDescription
rmrm -iRemove with confirmation
cpcp -iCopy with confirmation
mvmv -iMove with confirmation
mkdirmkdir -pvCreate directories (verbose, parents)

Search & Find

AliasCommandDescription
grepgrep --color=autoGrep with color output
fdfd --hidden --followFind files (include hidden, follow symlinks)
fdffd --type f --hidden --followFind files only
fddfd --type d --hidden --followFind directories only

Viewing Files

Using bat - modern cat with syntax highlighting.
AliasCommandDescription
batbat --style=plainView file with syntax highlighting (plain)
bcatbat --style=fullView file with full decorations

Utilities

AliasCommandDescription
wtfdmesg | tail -n 50Show last 50 kernel messages
wtfgdmesg | grep -iSearch kernel messages
fucksudo $(fc -ln -1)Re-run last command with sudo
lglazygitLaunch lazygit TUI
imgkitty +kitten icatDisplay image in terminal
fmyaziLaunch yazi file manager

FZF Integration

Fuzzy finder integrations for interactive selection.
AliasCommandDescription
fvv $(fzf --preview "bat...")Fuzzy find and edit file
fkillps -ef | fzf ... | xargs kill -15Fuzzy find and kill process
fhhistory | fzf ... | wl-copySearch history and copy to clipboard
fv shows a preview of files using bat before opening them in your editor.

Package Management (Pacman/Paru)

Installation & Removal

AliasCommandDescription
iparu -SInstall package
unparu -RnsUninstall package (with dependencies)
fixsudo pacman -Syu --noconfirmForce system update

Search & Info

AliasCommandDescription
sparu -SsSearch for package
siparu -SiShow package info (remote)
qipacman -QiShow package info (installed)
qspacman -QsSearch installed packages

Cleanup

AliasCommandDescription
cleanparu -ScClean package cache
cleanallparu -SccClean all package cache
orphanspacman -QdtList orphaned packages
rmorphansRemove orphan packagesRemove all orphaned packages

Package Queries

AliasCommandDescription
ownspacman -QoFind which package owns a file
lstpacman -QeList explicitly installed packages
lst-aurpacman -QmList AUR packages

Package Functions

function upgrade() {
  sudo pacman -Sy
  echo ":: Checking Arch Linux PGP Keyring..."
  local installedver="$(LANG= sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version         : ).*')"
  local currentver="$(LANG= sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version         : ).*')"
  if [ $installedver != $currentver ]; then
    echo " Arch Linux PGP Keyring is out of date."
    echo " Updating before full system upgrade."
    sudo pacman -S --needed --noconfirm archlinux-keyring
  else
    echo " Arch Linux PGP Keyring is up to date."
    echo " Proceeding with full system upgrade."
  fi
  paru -Su
}
Safely upgrades the system by checking and updating the PGP keyring first to prevent signature errors.

Git Aliases

Status & Info

AliasCommandDescription
ggitGit shorthand
gstgit statusShow status
gssgit status --shortShort status
gsbgit status --short --branchShort status with branch

Add (Staging)

AliasCommandDescription
gagit addAdd files
gaagit add --allAdd all files
gapagit add --patchAdd interactively
gaugit add --updateAdd modified files
gapgit add --patchInteractive patch mode

Commit

AliasCommandDescription
gcgit commit --verboseCommit with verbose diff
gcmgit commit --messageCommit with message
gcamgit commit --all --messageCommit all with message
gcagit commit --verbose --allCommit all (verbose)
gcsgit commit --gpg-signCommit with GPG signature
gcasmgit commit --all --signoff --messageCommit all with signoff

Amend Commits

AliasCommandDescription
gc!git commit --verbose --amendAmend last commit
gca!git commit --verbose --all --amendAmend with all changes
gcn!git commit --verbose --no-edit --amendAmend without editing message
gcan!git commit --verbose --all --no-edit --amendAmend all without editing
gcfgit commit --fixupCreate fixup commit

Branches

AliasCommandDescription
gbgit branchList branches
gbagit branch --allList all branches (including remote)
gbdgit branch --deleteDelete branch
gbDgit branch --delete --forceForce delete branch
gbmgit branch --moveRename branch
gbrgit branch --remoteList remote branches

Clean Gone Branches

AliasCommandDescription
gbgList “gone” branchesShow branches deleted on remote
gbgdDelete gone branchesDelete local branches removed from remote
gbgDForce delete gone branchesForce delete gone branches

Checkout & Switch

AliasCommandDescription
gcogit checkoutCheckout branch/commit
gcbgit checkout -bCreate and checkout branch
gcmgit checkout $(git_main_branch)Checkout main/master
gcdgit checkout $(git_develop_branch)Checkout develop branch

Git Switch (Git 2.23+)

AliasCommandDescription
gswgit switchSwitch branch
gswcgit switch --createCreate and switch to branch
gswmgit switch $(git_main_branch)Switch to main/master
gswdgit switch $(git_develop_branch)Switch to develop

Diff

AliasCommandDescription
gdgit diffShow changes
gdcagit diff --cachedShow staged changes
gdsgit diff --stagedShow staged changes
gdwgit diff --word-diffWord-level diff
gdtgit diff-tree --no-commit-id --name-only -rShow files in commit

Fetch

AliasCommandDescription
gfgit fetchFetch changes
gfagit fetch --all --pruneFetch all and prune
gfogit fetch originFetch from origin

Pull

AliasCommandDescription
glgit pullPull changes
gprgit pull --rebasePull with rebase
gpragit pull --rebase --autostashPull rebase with autostash
glucgit pull upstream $(git_current_branch)Pull from upstream (current)
glumgit pull upstream $(git_main_branch)Pull from upstream (main)
gglgit pull origin $(git_current_branch)Pull current branch from origin
gpromgit pull --rebase origin $(git_main_branch)Rebase on origin/main

Push

AliasCommandDescription
gpgit pushPush changes
gpfgit push --force-with-leaseSafe force push
gpf!git push --forceForce push (dangerous)
gpvgit push --verbosePush with verbose output
gpugit push upstreamPush to upstream
ggpgit push origin $(git_current_branch)Push current branch
gpsupgit push --set-upstream origin $(git_current_branch)Push and set upstream
gpoatgit push origin --all && git push origin --tagsPush all + tags

Log

AliasCommandDescription
glogit log --oneline --decorateOne-line log
gloggit log --oneline --decorate --graphGraph log
glogagit log --oneline --decorate --graph --allGraph log (all branches)
glggit log --statLog with stats
glgpgit log --stat --patchLog with patch
glolPretty graph logColored graph with author
glolaPretty graph log (all)Colored graph (all branches)
glodPretty graph (dates)With commit dates

Merge & Rebase

Merge

AliasCommandDescription
gmgit mergeMerge branch
gmagit merge --abortAbort merge
gmomgit merge origin/$(git_main_branch)Merge origin/main
gmsgit merge --squashSquash merge

Rebase

AliasCommandDescription
grbgit rebaseRebase branch
grbagit rebase --abortAbort rebase
grbcgit rebase --continueContinue rebase
grbigit rebase --interactiveInteractive rebase
grbmgit rebase $(git_main_branch)Rebase on main
grbomgit rebase origin/$(git_main_branch)Rebase on origin/main

Reset & Restore

AliasCommandDescription
grhgit resetReset changes
grhhgit reset --hardHard reset (discard all)
grhsgit reset --softSoft reset (keep changes staged)
gpristinegit reset --hard && git clean -dfxReset to pristine state
grsgit restoreRestore files (Git 2.23+)
grstgit restore --stagedUnstage files

Stash

AliasCommandDescription
gstagit stash pushStash changes
gstaagit stash applyApply stash
gstlgit stash listList stashes
gstpgit stash popPop stash
gstdgit stash dropDrop stash
gstcgit stash clearClear all stashes
gstsgit stash show --patchShow stash diff

Cherry-Pick

AliasCommandDescription
gcpgit cherry-pickCherry-pick commit
gcpagit cherry-pick --abortAbort cherry-pick
gcpcgit cherry-pick --continueContinue cherry-pick

Remote

AliasCommandDescription
grgit remoteList remotes
grvgit remote --verboseList remotes (verbose)
gragit remote addAdd remote
grrmgit remote removeRemove remote
grsetgit remote set-urlSet remote URL

Other Git Commands

AliasCommandDescription
gclgit clone --recurse-submodulesClone with submodules
gcleangit clean --interactive -dClean untracked files
gcountgit shortlog --summary --numberedCommit count by author
gignoregit update-index --assume-unchangedIgnore file changes
gunignoregit update-index --no-assume-unchangedUnignore file changes
grmgit rmRemove file
grmcgit rm --cachedRemove from index only
gshgit showShow commit
grevgit revertRevert commit
grfgit reflogShow reflog
gtagit tag --annotateCreate annotated tag
gtlgit tag --sort=-v:refname -n --listList tags
grtcd "$(git rev-parse --show-toplevel)"Go to repo root

Worktree (Git 2.5+)

AliasCommandDescription
gwtgit worktreeWorktree command
gwtagit worktree addAdd worktree
gwtlsgit worktree listList worktrees
gwtrmgit worktree removeRemove worktree

Git Helper Functions

function git_current_branch() {
  git symbolic-ref --short HEAD 2>/dev/null || \
  git rev-parse --short HEAD 2>/dev/null || return 1
}
Returns the current branch name or short commit hash.
function git_main_branch() {
  git rev-parse --git-dir &>/dev/null || return
  
  local ref
  for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,master}; do
    if git show-ref -q --verify $ref 2>/dev/null; then
      echo ${ref:t}
      return 0
    fi
  done
  
  echo master
  return 1
}
Intelligently detects whether the repo uses main, master, or trunk.
function git_develop_branch() {
  git rev-parse --git-dir &>/dev/null || return
  
  local branch
  for branch in dev devel develop development; do
    if git show-ref -q --verify refs/heads/$branch 2>/dev/null; then
      echo $branch
      return 0
    fi
  done
  
  echo develop
  return 1
}
Detects the development branch name.

Custom Shell Functions

mkcd() {
    mkdir -p "$1" && cd "$1"
}
Creates a directory (including parents) and changes into it.Usage: mkcd ~/projects/new-project
bak() {
    cp "$1" "$1.bak"
}
Creates a .bak copy of a file.Usage: bak important-file.txt
up() {
    local d=""
    local limit=${1:-1}
    for ((i=1 ; i <= limit ; i++)); do
        d="${d}../"
    done
    cd "$d"
}
Go up N directory levels.Usage: up 3 (goes up 3 levels)
down() {
    if ! command -v fd &> /dev/null || ! command -v fzf &> /dev/null; then
        echo "down: requires 'fd' and 'fzf'" >&2
        return 1
    fi

    local depth=${1:-1}
    local target=$(fd --type d --max-depth "$depth" . | fzf)
    [[ -n "$target" ]] && cd "$target"
}
Fuzzy find and navigate to a subdirectory.Usage: down 3 (search 3 levels deep)

Summary

General Aliases

  • Navigation & listing
  • File operations
  • System commands
  • FZF integrations

Git Aliases

  • 80+ git aliases
  • Smart branch detection
  • Helper functions
  • Worktree support

Package Management

  • Install/remove
  • Search & info
  • Cache cleanup
  • Orphan management

Custom Functions

  • mkcd, bak
  • up, down
  • Navigation helpers
All aliases use modern CLI tools like eza, bat, and fd for better performance and user experience.

Build docs developers (and LLMs) love