feat(shell): curated git/nix/navigation aliases on by default

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 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-06-16 17:46:17 +01:00
parent b856bb93e8
commit 017bb1aa41
2 changed files with 45 additions and 4 deletions

View File

@@ -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";
};
};