Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is there a way to do an automatic list-choices after successful completion of directory name?
- X-seq: zsh-users 10501
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Zsh Users' List" <zsh-users@xxxxxxxxxx>
- Subject: Re: Is there a way to do an automatic list-choices after successful completion of directory name?
- Date: Sun, 9 Jul 2006 17:36:46 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=lkxdvYQ2QlWIH1H8pzf1hWsB1F66/R3BW/AP3ZEKEMMH+kxeG+P1aUkQj8J3R1oZzerPQ2QAWFF+X2llbP+2gj0GICJphKMO++lHXR2lDjrzqc3j7agfSXiAJ9vo7KDclnhGx5mTsLAfpMClSTUi0wMsm9Ef7waChId9LZygIe4=
- In-reply-to: <dbfc82860607071129u27fff7e2l827d3e2bc62fbfd1@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dbfc82860607071129u27fff7e2l827d3e2bc62fbfd1@xxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 7/7/06, Nikolai Weibull <now@xxxxxxxx> wrote:
I would like list-choices to be run whenever I have completed a
directory name, e.g.,
$ cd ~/p<Tab>
completes to
$ cd ~/projects/
Once completed, I'd like list-choices to be called so that I can see
what directories I have under ~/projects immediately, instead of
having to type another <Tab> right after the first one.
Yes, there is in fact a way to do what you want:
_expand-or-complete-with-list-choices-after-local-directories () {
zle expand-or-complete
if [[ $_lastcomp[tags] == ' local-directories ' ]]; then
zle list-choices
fi
}
zle -N expand-or-complete-with-list-choices-after-local-directories
_expand-or-complete-with-list-choices-after-local-directories
bindkey "^I" expand-or-complete-with-list-choices-after-local-directories
I'm sure you can come up with a better name for it, but that's what it does...
Comments?
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author