From 017bb1aa41dc4fcb32225a2372e007dd7e4820fc Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Tue, 16 Jun 2026 17:46:17 +0100 Subject: [PATCH] feat(shell): curated git/nix/navigation aliases on by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the zsh shellAliases in shell.nix with a curated, on-by-default set: navigation (.., ..., ....), a git block (g, gst, ga/gaa, gc/gcm, gco/gsw, gb, gd/gds, gl/glg, gp/gpl, gf), a nix block (ns, nr, nfu, nfc, nsearch, ngc), and path/reload. Same restraint as rg/fd: short where it helps but never shadowing a real binary — the git set keeps off gs (ghostscript), and the system/home rebuilds keep their sys-update / home-update names rather than cryptic aliases. Co-Authored-By: Claude Opus 4.8 --- docs/ROADMAP.md | 12 ++++++++---- modules/home/shell.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 1def036..19f954d 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -113,10 +113,14 @@ how to override it. Items marked ✓ are shipped. summer-day/night menu buttons now use its `U+F000` glyph with `font-family: Nomarchy` pinned in their CSS (Nerd Fonts also occupy U+F000, so the pin is required). The other themes have no logo button. -- **Quality-of-life command aliases:** assemble a curated collection of - shell aliases/abbreviations for common operations (git, nix, navigation, - the nomarchy helpers, …), themed into the zsh shell experience - (`modules/home/shell.nix`). Decide scope and which to ship on by default. +- ✓ **Quality-of-life command aliases:** a curated set ships on by default in + `modules/home/shell.nix` — navigation (`..`/`...`/`....`), a git block + (`g`, `gst`, `ga`/`gaa`, `gc`/`gcm`, `gco`/`gsw`, `gb`, `gd`/`gds`, + `gl`/`glg`, `gp`/`gpl`, `gf`), and a nix block (`ns`, `nr`, `nfu`, `nfc`, + `nsearch`, `ngc`), plus `path` and `reload`. Scope decision: short where it + helps but **never shadow a real binary** (same rule as rg/fd — the git block + deliberately avoids `gs`/ghostscript); system/home rebuilds keep their full + `sys-update`/`home-update` names rather than getting cryptic aliases. - **Theme-switch feedback:** ✓ the "rebuilding…" notification is now persistent (timeout 0) and replaced in place by "applied ✓" / failure via a synchronous tag, so a multi-minute switch never reads as a failed diff --git a/modules/home/shell.nix b/modules/home/shell.nix index 654294b..d4d3780 100644 --- a/modules/home/shell.nix +++ b/modules/home/shell.nix @@ -35,6 +35,9 @@ in ignoreSpace = true; expireDuplicatesFirst = true; }; + # Curated, on by default. The rule (same as rg/fd above): short where + # it helps, but never shadow a real binary — so the git block keeps off + # `gs` (ghostscript), and nothing here masks a coreutil. shellAliases = { cat = "bat --paging=never"; less = "bat"; @@ -42,8 +45,42 @@ in # eza enableZshIntegration aliases ls/ll/la; add a couple extras. lt = "eza --tree --level=2 --icons=auto --group-directories-first"; tree = "eza --tree --icons=auto --group-directories-first"; + + # Navigation — climb without counting dots. ".." = "cd .."; "..." = "cd ../.."; + "...." = "cd ../../.."; + + # Git — the verbs you retype all day. + g = "git"; + gst = "git status -sb"; + ga = "git add"; + gaa = "git add -A"; + gc = "git commit"; + gcm = "git commit -m"; + gco = "git checkout"; + gsw = "git switch"; + gb = "git branch"; + gd = "git diff"; + gds = "git diff --staged"; + gl = "git log --oneline --graph --decorate -20"; + glg = "git log --oneline --graph --decorate --all"; + gp = "git push"; + gpl = "git pull"; + gf = "git fetch --all --prune"; + + # Nix — the flake/store verbs (system/home rebuilds already have the + # sys-update / home-update commands, so they're not re-aliased here). + ns = "nix shell"; # ns nixpkgs#ripgrep + nr = "nix run"; # nr nixpkgs#cowsay + nfu = "nix flake update"; + nfc = "nix flake check"; + nsearch = "nix search nixpkgs"; + ngc = "nix-collect-garbage -d"; # user generations; sudo for system roots + + # Misc. + path = "echo $PATH | tr ':' '\\n'"; + reload = "exec zsh"; }; };