zsh-users
 help / color / mirror / code / Atom feed
From: "Nikolai Weibull" <now@bitwi.se>
To: "Zsh Users' List" <zsh-users@sunsite.dk>
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	[thread overview]
Message-ID: <dbfc82860607090836g299ae3c4g78250770a845d399@mail.gmail.com> (raw)
In-Reply-To: <dbfc82860607071129u27fff7e2l827d3e2bc62fbfd1@mail.gmail.com>

On 7/7/06, Nikolai Weibull <now@bitwi.se> 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


  reply	other threads:[~2006-07-09 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 18:29 Nikolai Weibull
2006-07-09 15:36 ` Nikolai Weibull [this message]
2006-07-09 17:28   ` Bart Schaefer
2006-07-09 18:03     ` Nikolai Weibull
2006-07-09 18:15       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbfc82860607090836g299ae3c4g78250770a845d399@mail.gmail.com \
    --to=now@bitwi.se \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).