Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion for aliased commands does not work



On Oct 31, 11:12pm, Daniel Shahaf wrote:
} Subject: Re: completion for aliased commands does not work
}
} Fourhundred Thecat wrote on Mon, Oct 31, 2016 at 23:47:21 +0100:
} >   alias diff='colordiff'
} >   diff --<TAB>
} >   /usr/bin/diff --<TAB>
} 
} Completion "sees through" aliases.  You'll find that with the above
} alias, "diff <TAB>" and "colordiff <TAB>" behave the same way.

That's actually not true.  You have to "setopt complete_aliases" for
completion to "see through".  If for some reason you do not want to
set that, THEN:

} Therefore, define a completion for colordiff:
} 
}     compdef colordiff=diff



Messages sorted by: Reverse Date, Date, Thread, Author