zsh-users
 help / color / mirror / code / Atom feed
* do not add a space after completion
@ 2009-06-14  7:26 Eric Smith
  2009-06-14 16:03 ` Bart Schaefer
  2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Smith @ 2009-06-14  7:26 UTC (permalink / raw)
  To: zsh-users

I have a completion function that when executed should supply
no extra space after the option is given (on pressing <tab>).

Ideally it should append an underscore instead.

How would I achieve that (just for this function and not globally)?

thanks.

-- 
- Eric Smith


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: invoking compadd so that completion is for the second argument
@ 2009-06-23 20:17 Eric Smith
  2009-06-24  8:47 ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Smith @ 2009-06-23 20:17 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-06-24  8:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14  7:26 do not add a space after completion Eric Smith
2009-06-14 16:03 ` Bart Schaefer
2009-06-21 10:23   ` Eric Smith
2009-06-23 14:26 ` invoking compadd so that completion is for the second argument Eric Smith
2009-06-23 15:11   ` Bart Schaefer
2009-06-23 20:17 Eric Smith
2009-06-24  8:47 ` Peter Stephenson

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).