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

Re: completion fails if dir referenced via variable.

On 02/25/2014 09:46 AM, Bart Schaefer wrote:
On Feb 25,  7:21am, Ray Andrews wrote:
} if I type " cp $t1/filen [tab] " what happens is that
} " $t1 " expands just fine followed by " filen ". On the line below it
} says: " Completing all expansions ", but nothing happens.

This is the _expand completer at work.  It detects that there is a
variable that could be expanded, expands it, and returns 0, which
tells compsys that it doesn't need to try any other completions
until you have accepted this expansion.

You could try swapping the order of your completer zstyle from
_expand _complete to _compete _expand, or (if you have the default
bindings) you may be able to press ^Xn (_next_tags) to skip over
_expand and try _complete.
I tried the above and a few other things, but nothing improves the situation. So far the most useful line is:

zstyle ':completion:*' completer _expand _complete _correct _approximate

It seems intuitive that one should be able to have more than one expansion and/or completion per line, not just one, does it not? Why the artificial limitation? As a nasty work around, I can hit TAB once, which expands the variable, store the line to history, recall the line from history, and hit TAB again which completes the filename, but that seems like a whole lot of trouble.

Tell compsys it can't go home until all it's work is done ;-)

... mind, you say "until you have accepted" ... can I 'accept' one expansion/completion and have it go on to the next?

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