Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _expand completer and hashed dirs
- X-seq: zsh-users 14415
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: _expand completer and hashed dirs
- Date: Mon, 21 Sep 2009 15:54:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=dyg+tN0bI6I/86/0qcnx9EkjopJQPjqaOGcyPNKo0Zk=; b=xYIlXA6IMk8exPc1oJWudpsbkwZtbJE+F+LMUjjpa6D/cP9Qa+varmRFoCi/2KgIbY LwT99zY7Xhe7+cpQbmDKVMoS/GrLpH7kD23SP/+KgSJjlWJzeQn2s/5S/QZzg/ljPwtD LjHt5Sz1oSTwve/roYkrEhjh3SdQmzaOA+ids=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=yDEODmARlMh0ygmAfBVqieKhSuDE1Ur1JZlKPF/5aRU2Ousf7JjVXktVp81XCUCbwk Bpb711YWfxzqyqgHoxbg9xUOhyjUMgmrqlGlLbYweiztlbkBV97NCvgLZUPTyHm08Gsr rIwD/7tMhKA/1bkeRTQyjC2e4NYyECj1Rb36c=
- In-reply-to: <20090921134728.GA10174@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090921134728.GA10174@xxxxxxxxxxxxxxx>
2009/9/21 Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>:
> Hey list,
>
> Some time back I started using the _expand completer in my setup.
> And so far I like it.
>
> However, with hashed directories, I got a little problem I cannot seem
> to fix. Suppose, I got the following:
>
> 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.
> I've been playing with a number of styles, but they don't seem to
> have any impact on the situation.
>
> Here's a minimal zshrc, to reproduce what I'm seeing:
>
> [snip]
> bindkey -e
> hash -d vim=${HOME}/.vim
> autoload -Uz compinit
> compinit
> zstyle ':completion:*:descriptions' format "- %d -"
> zstyle ':completion:*' group-name ''
> zstyle ':completion:*' completer _expand _complete _ignored _approximate
> [snap]
>
> Does anybody have a clue as to how to cure this?
You could try putting _expand after _complete, but maybe you won't
like what it does with other constructs then. (I'm guessing you
rebound ^I to complete-word rather than expand-or-complete). If that
doesn't do what you want, I think you'd have to use two different
keybinds for completing and expanding.
ie something like
zstyle ':completion:most-recent-file:*' match-original both
zstyle ':completion:most-recent-file:*' file-sort modification
zstyle ':completion:most-recent-file:*' file-patterns '*:all\ files'
zstyle ':completion:most-recent-file:*' hidden all
zstyle ':completion:most-recent-file:*' completer _files
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 :).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author