In zsh, I have a function called g
which acts like this:
git status
The documentation for compdef says this:
The function
compdef
can be used to associate existing completion functions with new commands. For example,compdef _pids foo
But adapting it (_git
is the usual completion function for git) did not produce a working result for me (even after _git
had been autoloaded):
compdef _git g
I was able to get it to work via _dispatch
though:
compdef '_dispatch git git' g