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

Re: how to allow tab completion in `flag=complete_me` ? (ie after a customizable symbol like `=`)



On Mon, 16 Jan 2017 23:15:33 -0800
Timothee Cour <timothee.cour2@xxxxxxxxx> wrote:
> ```
> $ dmd -of ~/READ[TAB] => TAB completion works
> $ dmd -of=~/READ[TAB] => no TAB completion because preceeded by `=`
> ```
> 
> how would I customize the separators after which TAB completion operates?

In this case, your best bet might be simply "setopt magicequalsubst".
That means all "=" on the command line are treated (roughly) like
assignments for the purpose of expansion.  Unless you regularly have =
as part of a file name that should be fine.

Detailed configuration of completion tends to be quite murky as its
specific to the context you're in.  The usual answer would be to
write a completer for dmd using _arguments and tell it that
-of is an option accepting "=" and taking file arguments.  There
are umpteen examples of this in the completion system.  We'd
distribute a completion for _dmd if someone wrote one.

pws



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