3 ms·
I use fish shell, which lets you create abbreviations. Abbreviations are like shell aliases, except that after you type them, they expand to the entire command
by szhu 7y ago
I use fish shell, which lets you create abbreviations. Abbreviations are like shell aliases, except that after you type them, they expand to the entire command -- so it helps you memorize the real thing as well! Also there's auto-complete, which helps you find your saved abbreviations.
For example, to save an abbreviation:
$ abbr undo-unpushed-commit 'git reset --hard HEAD^'
... later ...
Start typing a few chars and it'll suggest the rest:
$ undo-u|npushed-commit
Press the right arrow key to accept the suggestion
$ undo-unpushed-commit|
When you press enter or space, the abbreviation will expand:
$ git reset --hard HEAD^ |
---
There are a lot of other reasons to use fish shell. For example, when you save abbreviations or functions or aliases, they immediately persist and propagate to other shell windows!
https://fishshell.com/ https://fishshell.com/