I am using zsh.
I have a command foo
, and I use alias foo="sudo foo"
as a shortcut. I want zsh to complete the command just like I typed foo
.
I googled and found compdef _foo f=foo
which can deal with it. When I type f something<tab>
, the completion works fine. But when I try compdef _foo foo=foo
and then foo something<tab>
, it does not work.
Is there a way to deal with the Tab completion when I use an alias with the same name as the original command?