Alias in ZSH with completion
I use git in a terminal all day, every day. 3 characters adds up if you type them enough,
g i t, so let’s shorten what we have to type.
You shorten a command by making a shorter alias. So I alias
I like terminal commands with completion, especially a command like git with a many, long arguments. Aliases do not automatically assume the original command’s completion. Here’s how we add completion to our alias:
And boom! You can do
g st<TAB> to complete
compdef makes the g alias complete as if ZSH was completing git instead.
Now I git away by typing