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

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



Good evening!

I have a few questions regarding some different completion mechanisms in zsh.

1) I noticed that $_<TAB> does not expand. I am wondering if other parameter substitutions do expand and, if so, if there is an equivalent for $_ that is similarly pithy. If not, is this something that deserves a feature request?

2) Quick history substitution does not expand in subcommands. For instance, the following example does nothing. I am not sure if this is also something that would warrant a feature request.
$ touch foo
$ echo $(^touch^cat)

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. This one feels like a bug proper, but it may have something to do with what I am attempting in particular.

$ grep -r foo
$ vim $(!!:s/-r/-rl)<TAB> -> vim $(grep -rl) foo

whereas

$ grep -r foo
$ vim $(!!:s/-r/-rl/)<TAB> -> $ vim $(grep -rl foo)

If anyone has any thoughts or suggestions about this, I would really appreciate the feedback. Thanks!

- Sonny



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