Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
insert-all-matches example RE: completion and globbing, part 2
- X-seq: zsh-users 3437
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "E. Jay Berkenbilt" <ejb@xxxxxx>, <zsh-users@xxxxxxxxxxxxxx>
- Subject: insert-all-matches example RE: completion and globbing, part 2
- Date: Mon, 18 Sep 2000 13:59:46 +0400
- Importance: Normal
- In-reply-to: <000701c0213d$2434b6d0$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
>
> May be, widget to do it (insert all current choices) would be the simplest
> case. Hmm ... may be it is even possible to implement it as function.
>
Very dumb implemetation. It won't work (correctly) if anything is already
inserted on command line - that is, it will insert all matches directly after
anything already there. This may or may not be appropriate.
bor@itsrm2% which _insert_all_matches
_insert_all_matches () {
compstate[insert]=all
compstate[old_list]=keep
_complete
}
bor@itsrm2% zle -C insert-all-matches complete-word _insert_all_matches
bor@itsrm2% bindkey '^Xi' insert-all-matches
With these you could do:
bor@itsrm2% ls f*^D
bor@itsrm2% ls f*
Completing file
fnt/ foo.c
Now press ^Xi
bor@itsrm2% ls fnt foo.c
But, as stated, it has all sorts of problems. It does not work correctly after
*completion* - it tries to complete word already inserted (that is, it is
treated as new completion instead of continuation of old - but this may be
related to my styles settings). ^D is needed to get a list that is inserted
with ^Xi.
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author