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

Re: _expand completer and hashed dirs



Mikael Magnusson <mikachu@xxxxxxxxx>:
> 2009/9/21 Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>:
[...]
> > hash -d vim=${HOME}/.vim
> >
> > While this works fine:
> >
> >    % ls ~vi<tab>
> >    % ls ~vim/
> >
> > This doesn't:
> >
> >    % ls ~vim<tab>
> >    - all expansions -
> >    /home/hawk/.vim
> >    - original -
> >    ~vim
> >
> > I would much rather like to get 'ls ~vim/' out of it.
[...]
> 
> You could try putting _expand after _complete, but maybe you won't

I tried that. While that cures the ~vim<tab> problem, it stops
variables from being expanded, like:

    % print $HISTSIZE<tab>
    % print 9999

Also, the compsys(1) manual advises one to use _expand before
_complete, for full pleasure. :)

> like what it does with other constructs then. (I'm guessing you
> rebound ^I to complete-word rather than expand-or-complete). If that

Yes, I did that.

> doesn't do what you want, I think you'd have to use two different
> keybinds for completing and expanding.
> 
> ie something like
[...]
> zle -C most-recent-file menu-complete _generic
> bindkey "^N"      most-recent-file
> 
> but not _files and another name for the completer would probably make sense :).

I do have similar bindings. But that's not what I'm looking for.
If there's no other way around it, I'll probably learn to use
'~vi<tab>' instead of '~vim<tab>'. :)

Regards, Frank



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