Guide 6 of 7 · Toolbox

The toolbox

The other guides explain how it works. This one is the cheat sheet: what you get, and which keys to press.

The shopping list

The Brewfile is a plain list of everything Homebrew should install. Add a line, run brew bundle --global, and the tool is on this Mac. Commit the line, and it is on the next Mac too.

CommandWhat it does
brewupThe whole maintenance run in one word: update, upgrade, clean up, health check.
make brew-driftCompares this Mac with the Brewfile and lists what each has that the other lacks.
make auditAsks Homebrew and GitHub whether anything on the list has been renamed, deprecated or abandoned.

Two terminal apps, one look

Either Apple's Terminal.app or Ghostty can be the window. They are set up to match, and both step into tmux when a window opens.

The prompt

The prompt is drawn by Starship. It stays quiet until there is something to say.

dotfiles on main *
➜

The arrow is green after a command that worked and red after one that failed. Inside a git repository the prompt adds the branch, a * when files have changed, and arrows when you are ahead of or behind the remote. A helper also speaks up when you type a long command that already has a shortcut.

Git

Nine shell shortcuts cover the commands typed most often. They are defined in config/zsh/lib/git.zsh, and adding one is a single line there.

TypeRunsTypeRuns
ggitgfrgit pull --rebase
giagit addgpgit push
gcogit checkoutgpfgit push --force-with-lease
gbcgit checkout -bgrgit rebase
gfcgit clone

Git itself has a few more, from config/git/config:

CommandWhat it does
git stStatus.
git undoTakes back the last commit but keeps its changes.
git lgThe history as a colored graph of every branch.
git lThe history as one line per commit, date first.
git cleanupDeletes merged local branches whose remote branch is gone.
gh coChecks out a pull request by number.

How git behaves here

tmux

tmux splits one terminal window into panes and tabs, and keeps them running when the window closes. Every tmux key starts with the prefix, which is Ctrl A here. Press it, let go, then press the next key.

After the prefixWhat happens
|   -Split the pane side by side, or one above the other. The new pane opens in the same folder.
h j k lMove to the pane on the left, below, above or right.
H J K LResize the pane in that direction. Hold to repeat.
cA new tab, in the same folder.
RReload the tmux settings.

Finding things

fzf is a fuzzy finder: type a few letters from anywhere in a name and it narrows the list as you go.

KeysWhat it finds
Ctrl TA file under the current folder, including hidden files and ones git ignores.
Ctrl RA command from your history.
Alt CA folder to jump into.
↑   ↓Type part of a command first, and the arrows step through the history entries that contain it.
TabCompletion with a menu. It ignores capitals and forgives a typo.

The editor

Neovim is set up as a quick editor for commit messages and config files, not as a second IDE. It has five plugins, pinned to exact versions by a lockfile. vim and vi both open it. The leader key is Space.

KeysWhat happens
Space SpaceFind a file.
Space hRecently opened files.
Space bOpen buffers.
Space /Search the whole project.
Space dProblems in this file.
EscClear the search highlight.
ys ds csAdd, delete or change the quotes or brackets around something.
gaLine things up in columns.

Commit messages get special treatment: a ruler at 72 characters, spell checking, and the cursor on the subject line.

Languages and projects

Small conveniences

CommandWhat it does
pathPrints PATH one folder per line, in color.
kpPick running programs from a fuzzy list and stop them.
curltFetches a URL and shows where the time went.
checkipPrints this Mac's public IP address.
randommacGives the Wi-Fi card a random hardware address.
rm_node_modulesDeletes every node_modules folder below the current one.

One job needs no helper: ssh-keygen -R <host> makes SSH forget a server's old fingerprint after the server has been rebuilt.

Outside the terminal

Switches

VariableEffect when set
ZSH_NO_TMUX_AUTOSTARTThis shell does not step into tmux.
ZSH_NO_ZCOMPILESkips the background compile of the completion index.
DOTFILES_URL, DOTFILES_REFWhere script/bootstrap installs from.