---
title: Terminal Cheatsheet
tags:
  - fish
  - zsh
  - wezterm
  - terminal
  - cheatsheet
  - lsd
  - bat
  - fzf
  - zoxide
  - lazygit
  - claude-code
created: 2026-04-15
updated: 2026-04-16
aliases:
  - Terminal Stack Cheatsheet
  - Shell Cheatsheet
---

# Terminal Cheatsheet

Reference for the daily terminal stack: **WezTerm** + **fish** (default) / **zsh**, with modern CLI replacements (lsd, bat, fd, rg, zoxide, fzf, lazygit) and Claude Code shortcuts.

> [!tip] Live cheatsheet on disk
> Mirrored to `~/.cheatsheet.txt` and printed automatically on every new interactive shell (both fish and zsh). Type `cheat` or `help` at any prompt to reprint it.

See also: [[wiki/dotfiles/linux-terminal-ricing|linux-terminal-ricing]].

---

## Git — quick aliases

| Alias | Command |
|-------|---------|
| `gs` | `git status` |
| `ga <files>` | `git add` |
| `gc` | `git commit` |
| `gd` | `git diff` |
| `gl` | `git log --oneline` |
| `gp` / `gpl` | `git push` / `git pull` |
| `lg` | `lazygit` (TUI) |

## Git + fzf (forgit plugin)

Interactive fuzzy-finder versions of git commands — pick files / commits / branches visually with diff previews.

| Abbr | Action |
|------|--------|
| `fga` | interactive `git add` — pick files via fzf |
| `fgd` | interactive diff picker |
| `glo` | git log picker with diff preview |
| `gi` | generate `.gitignore` for any language |
| `gco` | checkout commit from fzf list |
| `gcb` / `gsw` | checkout / switch branch (fzf) |
| `gbd` | delete branch (fzf multi-select) |
| `gcf` | checkout single file (fzf) |
| `grh` | reset HEAD (fzf on staged files) |
| `gss` / `gsp` | stash show / push (fzf) |
| `gcp` | cherry-pick from branch (fzf) |
| `grb` / `gsq` / `gfu` | interactive rebase / squash / fixup |
| `grc` | revert commit (fzf) |
| `gclean` | clean untracked (fzf multi-select) |

> [!info] Conflict resolution
> forgit's default `ga` and `gd` conflict with the quick-aliases above. Renamed to `fga` / `fgd` via `set -U forgit_add fga` and `set -U forgit_diff fgd`.

### lazygit shortcuts

| Key | Action |
|-----|--------|
| `Tab` | switch panels |
| `Space` | stage / unstage file |
| `a` | stage / unstage all |
| `c` | commit |
| `P` / `p` | push / pull |
| `b` / `n` | branches / new branch |
| `Enter` | file diff |
| `?` | help · `q` quit |

---

## Docker

| Alias | Command |
|-------|---------|
| `d` | `docker` |
| `dc` | `docker compose` |
| `dps` | `docker ps` |
| `dex <id>` | `docker exec -it <id>` |
| `dlog <id>` | `docker logs -f` |

---

## Modern CLI replacements

```fish
ls               # lsd
ll               # lsd -la
lsd --tree       # tree view
cat file.txt     # bat (syntax highlighting)
bat -n file.txt  # with line numbers
find kitty.conf  # fd (fd-find)
fd -e md         # all .md files
grep 'TODO' .    # rg (ripgrep)
rg -i 'error'    # case-insensitive
rg --type=ts 'useState'
```

### zoxide — smart cd

```fish
z kitty     # jumps to any dir matching "kitty" in frecency db
z -         # back
zi          # interactive fzf picker
```

### fzf — fuzzy finder

```fish
fzf              # pick a file
nvim (fzf)       # open picked file in nvim
cd (fzf)         # cd into picked dir
Ctrl+R           # fuzzy history search
```

---

## Python / Node

| Alias | Command |
|-------|---------|
| `py` | `python3` |
| `venv` | `python3 -m venv .venv && activate` |
| `nvm use <ver>` | switch Node.js version |

---

## SSH servers

| Alias | Host |
|-------|------|
| `ssh-optical` / `ssh-optical-dev` / `ssh-optical-prod` | Optical stack |
| `ssh-librechat-dev` / `ssh-librechat-prod` | LibreChat |
| `ssh-modcomms` | ModComms dev |
| `ssh-baic` | BAIC |
| `ssh-box` | Box CLI jump host |
| `ssh-aimpress` | Aimpress |

---

## Claude Code

| Command | Action |
|---------|--------|
| `claude` | launch Claude Code |
| `clauded` | `claude --dangerously-skip-permissions` (fish function) |
| `/help` | in-session help |
| `/fast` | toggle fast mode (Opus 4.6) |
| `/loop <interval> <cmd>` | recurring task |
| `/schedule` | cron-based triggers |

---

## WezTerm hotkeys

| Key | Action |
|-----|--------|
| `⌘T` / `⌘W` | new tab / close pane |
| `⌘D` / `⌘⇧D` | split horizontal / vertical |
| `⌘⏎` | zoom current pane |
| `⌘⌥ hjkl` | navigate panes |
| `⌘⇧ hjkl` | resize panes |
| `⌘1..9` | jump to tab N |
| `⌘F` / `⌘⇧P` | search / command palette |
| `⌘⇧Space` | QuickSelect — copy URL/path in one keystroke |
| `⌘⇧U` | emoji / unicode picker |
| `⌘K` | clear screen + scrollback |
| `⌘⇧R` | reload config |
| `⌃A` + `s` | workspace launcher |
| `⌃A` + `n` / `p` | next / prev workspace |
| `⌃A` + `c` | create workspace |
| `⌃A` + `r` | rename current tab |

---

## Fish shell basics

| Key | Action |
|-----|--------|
| `→` | accept autosuggestion |
| `Alt+→` | accept one word |
| `Ctrl+R` | fuzzy history search |
| `Ctrl+A` / `Ctrl+E` | start / end of line |
| `Ctrl+L` | clear screen |
| `Ctrl+C` | interrupt |

### fzf.fish bindings (plugin)

| Key | Action |
|-----|--------|
| `Ctrl+R` | history search with preview |
| `Ctrl+Alt+F` | find files in cwd (bat preview) |
| `Ctrl+Alt+S` | git status files |
| `Ctrl+Alt+L` | git log picker (diff preview) |
| `Ctrl+Alt+P` | kill process picker |
| `Ctrl+V` | shell variables picker |
| `Ctrl+Alt+D` | cd into any subdir (tree preview) |

## Fun / visual

| Command | Action |
|---------|--------|
| `poke` | random Pokémon ASCII art |
| `fastfetch` | system info (prints on shell start) |

## Fish plugin sugar

Installed via `fisher`: autopair, puffer-fish, sponge, colored_man_pages, done, forgit, fzf.fish, tide.

| Input | Effect |
|-------|--------|
| `(`, `[`, `{`, `"`, `'` | **autopair.fish** — auto-closes the matching pair |
| `...` → `../..` | **puffer-fish** — dot expansion (add more dots for more levels) |
| `!!` / `!$` | last command / last arg (puffer-fish bang expansion) |
| `$x` → `$(x)` | puffer-fish variable expansion |
| `man <cmd>` | **colored_man_pages** — syntax-highlighted manpages |
| long cmd (>5s) finishes in background | **done** — macOS notification pops up |
| typo / failed command | **sponge** — removes it from history automatically |

---

## superfile (`spf`)

| Key | Action |
|-----|--------|
| `↑↓` / `jk` | navigate |
| `Enter` | open |
| `Backspace` | parent dir |
| `Space` | select |
| `d` / `r` | delete / rename |
| `c` / `x` / `v` | copy / cut / paste |
| `n` / `N` | new file / folder |
| `/` | search · `?` help · `q` quit |

---

## btop

| Key | Action |
|-----|--------|
| `k` | kill process |
| `f` | filter |
| `1-4` | sort column |
| `q` | quit |

---

## Neovim / LazyVim

| Key | Action |
|-----|--------|
| `Space` | leader (main menu) |
| `Space e` | file tree |
| `Space ff` | find files |
| `Space fg` | grep project |
| `Space gg` | lazygit inside nvim |
| `i` / `Esc` | insert / normal |
| `:w` / `:q` / `:wq` | save / quit / save+quit |

---

## Key Takeaways

- The shell stack is **fish (default) + zsh (fallback)**, both wired to the same aliases and the same `~/.cheatsheet.txt` greeting.
- Modern CLI tools shadow the classics: `ls`→`lsd`, `cat`→`bat`, `find`→`fd`, `grep`→`rg`, `cd`→`z`.
- WezTerm uses a **tmux-style leader (`⌃A`)** for workspaces, plus Cmd-based tab/pane navigation — see [[wiki/dotfiles/linux-terminal-ricing|linux-terminal-ricing]] for the philosophy.
- Type `cheat` or `help` to reprint this cheatsheet anywhere.
