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

RE: Getting context sensitive glob expansions using new completion



> 
> completer
>         :completion:* _expand _complete _ignored _approximate _prefix
> glob
>         :completion:*:expand:* 1
> tag-order
>         :completion:*:expand:* all-expansions expansions original
> 
> I also have menu completion switched off at all times (apart from
> _approximate).
> 
> So then when I type eg.
>      ls *<tab>
> the * is expanded immediately into a full list of files (by _expand,
tab
> being mapped to complete-word).
> 
> This is what I want for ls. However, in general I would like the *
> expansion to be the list of things valid at the point rather than
always a
> list of files, which is what I currently get.
> 

That is what _match is for. I personally find unconditional _expand on
every TAB bad idea - you always have ^Xe (or ^XE) for that. 

zstyle ':completion:*' completer _oldlist _complete _match

_oldlist makes sure that you are using original expansions when
continuing completion (else second TAB may complete too much).

-andrej



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