Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: invoking compadd so that completion is for the second argument
- X-seq: zsh-users 14203
- From: Eric Smith <es@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: invoking compadd so that completion is for the second argument
- Date: Tue, 23 Jun 2009 22:17:01 +0200
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Thanks Bart
Bart Schaefer said:
> For example, given a command line such as:
>
> % roger dodger codger
>
> Do you mean:
>
> (1) The completion for "roger" is invoked, but the set of matches for
> "codger" is not the same as the set of matches for "dodger"; or
Something like this, indeed.
I create commands that allow me to copy or move existing files to
special named files. The prefix of these special names I want
to look up from a list in a file referenced by compadd.
So the command:
% prefix_cp sour<tab>
will just complete as per the default rules, but
% prefix_cp source_file.pdf <tab>
should give me:
% prefix_cp source_file.pdf aa_code_reference_00034
assuming this was the first match in the list
<parenthesis>
Oh I just had an idea for the first time now writing this.
If I went:
% prefix_cp source_file.pdf aa_code_reference_00034_<tab>
It would be great to have as the completion the first arg viz.
!#1 or `source_file.pdf'
But this is a bonus.
</parenthesis>
Thanks a lot.
Eric
Messages sorted by:
Reverse Date,
Date,
Thread,
Author