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

Re: Variable expansion problem



On Tue, 25 Sep 2007 12:08:20 +0100
"John Cooper" <john.cooper@xxxxxxxxxxxxx> wrote:
> Thanks for the reply, although it doesn't seem to be working for me.
> (the space between the 2 args is still quoted.). I suspect I'm doing
> something wrong!

Is <TAB> still bound to expand-or-complete?  (If you don't have _expand in
your completers it probably is.)  In that case, rebind it:

bindkey '\t' complete-word

You might want to add that _expand to your completers to restore expansion
to (almost) how it worked before.

Alternatively, you could bind the new function (defined as a completion
widget) to a different key

> I don't really understand the code, and I'm not sure what you mean by
> "only kicks in if the entire word matches $<paramname>.", as there is no
> <paramname> in the code - did you mean it kicks in when the entire param
> name matches "$IDENT"?

<paramname> just meant any parameter name.

> Btw, what is the "P" referring to in ${(P)+val}? 

That causes $val to be treated as the name of another parameter.

> I think what I really want is to be able to type
>   Prompt> $SITEMGR -c <TAB>
> .. and have it complete to:
>   Prompt> $SITEMGR -c ...

You'd need to define a completion for the expansion of $SITEMGR;
a completion for the basename of the command would be enough.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


.



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