paulirish / dotfiles

paul's fish, bash, git, etc config files. good stuff.
4.2k stars 1.31k forks source link

Convert typo aliases to abbreviations #108

Closed hivehand closed 4 years ago

hivehand commented 4 years ago

This should be considered more of a “Hey, did you know about…?” than a pull request.

Fish has an abbr command that lets you replace one string, when used as a command, with another. (The substitution can be shorter than the original, e.g. yarn in place of yearn, so abbr can be a bit of a misnomer.)

https://fishshell.com/docs/current/commands.html#abbr

The principal difference between an abbr and an alias is that the abbr substitution happens as you type, which I happen to find kind of neat. More practically, it means that you don't have to search your command history for all possible variations of its name. I don't have to go digging for all instances of git and gti when trying to recall something I did recently, because the latter were transformed to git before I hit return.

Hope you find this edifying and/or useful. Thanks for sharing all of your dotfiles!

paulirish commented 4 years ago

SUPER useful! that's great. thanks a bunch!