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

Re: _expand completer and hashed dirs



Peter Stephenson <pws@xxxxxxx>:
> Frank Terbeck wrote:
> > Some time back I started using the _expand completer in my setup.
> > And so far I like it.
> >...
> >     % ls ~vim<tab>
> >     - all expansions -
> >     /home/hawk/.vim
> >     - original -
> >     ~vim
> > 
> > I would much rather like to get 'ls ~vim/' out of it.
> 
> Mikael's interpretation might be the correct one, but I read this as
> saying you don't want certain expansions.  If that's the case, there is
> a certain amount of configuration, but you're going to have to be more
> specific about what you want expanded or not.
> 
> There's no style specific to suppressing ~-expansions, though it's
> probably not hard to add given that luckily the ~ is always at the
> start.
> 
> You might simply want the subst-globs-only style, however.

What I had hoped, was this to work:

zstyle ':completion:*:-tilde-:*' completer _complete _ignored _approximate
zstyle ':completion:*'           completer _expand _complete _ignored _approximate

Because the manual says:

[snip]
-tilde-
    After an initial tilde (`~'), but before the first slash in the
    word.
[snap]

And since the longer style should win against the shorter one, I would
have expected it to work. But evidently, it doesn't. What would be the
reason for that?

Regards, Frank



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