Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tip of the day: previous command output
- X-seq: zsh-users 7902
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Tip of the day: previous command output
- Date: Sun, 22 Aug 2004 23:21:26 +0200
- In-reply-to: <Pine.LNX.4.61.0408200905300.27591@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040819085812.GL22962@localhost> <Pine.LNX.4.61.0408190748530.9464@xxxxxxxxxxxxxxxxxx> <20040819164250.GA21575@xxxxxxxxx> <Pine.LNX.4.61.0408190956440.9464@xxxxxxxxxxxxxxxxxx> <20040820121202.GA31466@xxxxxxxxx> <20040820145032.GH13530@xxxxxxxxxxxxx> <Pine.LNX.4.61.0408200905300.27591@xxxxxxxxxxxxxxxxxx>
- Sender: Vincent Lefevre <vincent@xxxxxxxxxx>
On 2004-08-20 21:25:47 -0700, Bart Schaefer wrote:
> On Fri, 20 Aug 2004, Vincent Lefevre wrote:
> > And would it be possible to get a menu, in order to select one or
> > several filenames manually?
>
> For that we get a little more intense:
>
> _insert_kept() {
> (( $#kept )) || return 1
> local action
> zstyle -s :completion:$curcontext insert-kept action
> if [[ -n $action ]]
> then compstate[insert]=$action
> fi
> compadd -a kept
> }
> zle -C insert-kept-result complete-word _generic
> zstyle ':completion:insert-kept-result:*' completer _insert_kept
>
> Now you get Andy's thing with
>
> zstyle ':completion:*' insert-kept all
>
> Or you can get menu completion with
>
> zstyle ':completion:*' insert-kept menu
>
> and it does menu completion according to whatever your other usual
> styles are (or you can add other specific styles for this context).
I was talking about another kind of menu (which could be useful for
standard completion too). For instance, there could be a cursor for
the (standard zsh) menu, or perhaps a number, to be able to choose
one or several word candidates.
$ echo [TAB]
[ab] ef ij
cd gh kl
[...] represents the cursor around "ab".
or
$ echo [TAB]
1 ab 3 ef 5 ij
2 cd 4 gh 6 kl
then typing some key followed by the number would insert the word.
This may be useful when there are many common prefixes (this often
occurs in practice).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author