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

Re: Sundry Completion Questions ($_ $(^^) $(!!:s//)



On Nov 1, 2014 5:39 PM, "Sonny Michaud" <michaud.sonny@xxxxxxxxx> wrote:
>
> 1) I noticed that $_<TAB> does not expand.

It expands for me.  It doesn't expand to anything very useful, because its
value changes during the execution of the completion functions, but it does
expand.

Do you have _expand in your "completer" zstyle?

> 2) Quick history substitution does not expand in subcommands.

Quick history substitution is a command-line construct, not a command
syntax construct.  It only works when the quick-history character appears
as the first character of the input buffer.

> 3) Since the above does not work, I usually use $(!!:s/foo/bar), which
has bizarre behavior, depending on whether or not a trailing slash is
provided.

History syntax doesn't interact with shell command syntax in the way you
are expecting.  *Everything* after the second slash, *including* the
closing paren, is part of the history reference unless you close the
history syntax by adding the third slash.

History substitution is a purely lexical replacement which occurs before
any shell-syntax analysis of the input is performed.


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