Fish Shell Abbreviations

I’ve been a fish shell convert for quite a while now. One pet peeve that I’ve had ever since is that aliases and completetion do not play well together.

If you have alias g='git' in your config, writing the command g checkout a<TAB> will not complete branch names that start with the letter A.

I recently decided to look if it was fixed and I stumbled upon abbreviations.

set -U fish_user_abbreviations 'g=git'

Abbreviations are expanded inline as they are being typed and in turn solves the completion problem.

P.S. This is supposedly solved as described in this comment but it was not available in the version currently installed by Homebrew. In all cases, I really like the idea of aliases being expanded to their full commands inline.

Learn More

Subscribe via RSS