Skip to main content

Command Palette

Search for a command to run...

Why Abbreviations Replaced Every Alias in My Shell

Updated
•3 min read•View as Markdown
S
I'm Sushanth, a high school senior in Hyderabad, India. This is where I write about the things I spend time on: learning from mistakes, building things in code, and the tools I actually work with day to day. I hold the Candidate Master title and a FIDE International Master norm, earned across roughly 140 rated tournaments in six countries. I stopped competing in 2025, but the habit competition taught me, sitting down after every loss and figuring out exactly where I went wrong, shapes how I approach everything else. On the technical side, I've gone deep on C/C++ through Duke University and University of London coursework. I'm also someone who likes a good terminal workflow and enjoys exploring (and abandoning) productivity tools. Expect posts on Neovim, tmux, what broke this week, and whatever I'm tinkering with.

Aliases execute silently and leave you with a shell history full of two-letter shortcuts you cannot read six months later.

When you start spending serious time in a terminal, writing aliases feels like free productivity. You alias git status to gs, git commit -m to gcm, and docker compose to dc. Within a couple of months you have fifty little shortcuts scattered across your shell config. You feel fast right up until you hit the two problems every alias user eventually runs into.

The first problem is command history. Aliases substitute silently at execution time. When you type gpf, your shell runs git push --force-with-lease, but what gets written to your history file is literally gpf. Six months later, when you grep your history to see how you handled a tricky rebase or what flags you passed to an obscure CLI tool, your history is a graveyard of cryptic two-letter acronyms. Half the time you cannot even remember what the underlying flags were because you stopped typing them a year ago.

The second problem is editing arguments. If gcm expands to git commit -m, but you suddenly want to add --amend without changing the message, you cannot just reach into the middle of the alias. You end up backspacing the whole line to type the command manually, or you write another alias like gca or gcan. Your config keeps ballooning to cover minor variations of the same handful of tools.

In fish shell, abbreviations solve both problems without giving up any typing speed.

abbr -a gs git status
abbr -a gc git commit
abbr -a gpf git push --force-with-lease
abbr -a gl git log --oneline --graph --decorate -20
abbr -a dc docker compose

An alias substitutes behind the scenes when you press enter. An abbreviation substitutes visually the instant you tap the spacebar.

You type gpf, press Space, and the prompt immediately expands to git push --force-with-lease . You see the exact command on screen before it ever executes. If you want to tack on --dry-run, you just keep typing. And when you hit Enter, what gets logged in your shell history is the actual command with every flag spelled out. When you search your history six months from now, the real invocation is right there.

My config has a simple division of labor now. Abbreviations handle commands where I want to see what is running, add flags on the fly, or search for the syntax later in history. Aliases are reserved strictly for permanent defaults (like aliasing ls to eza so directories always display icons). My alias list shrunk to almost nothing, and my shell history is finally readable again.