zsh-users
 help / color / mirror / code / Atom feed
* completion for darcs
@ 2005-04-01  8:06 Andrei A. Voropaev
  2005-04-01  8:09 ` Andrei A. Voropaev
  0 siblings, 1 reply; 12+ messages in thread
From: Andrei A. Voropaev @ 2005-04-01  8:06 UTC (permalink / raw)
  To: zsh-users

Hello!

System of completion in zsh is very powerful and very addictive :) The
more painful it is, when it fails for some reason. I was very impressed
with completions for gnu arch commands. And now I'm trying out darcs,
but seems like here completion is not so good. I'd rather say it hinders
me instead of helping. The very first thing I try to do is to add a
file. So I do 'darcs add f<Tab>'. All I get in response is "Completing
`arg for darcs command'". No file name. So I have use copy/paste to get
file names into command line.

What could be the problem here? Any solutions?

-- 
Minds, like parachutes, function best when open


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

* Re: completion for darcs
  2005-04-01  8:06 completion for darcs Andrei A. Voropaev
@ 2005-04-01  8:09 ` Andrei A. Voropaev
  2005-04-01  9:32   ` Antoine Calando
  0 siblings, 1 reply; 12+ messages in thread
From: Andrei A. Voropaev @ 2005-04-01  8:09 UTC (permalink / raw)
  To: zsh-users

On Fri, Apr 01, 2005 at 10:06:20AM +0200, Andrei A. Voropaev wrote:
> Hello!
> 
> System of completion in zsh is very powerful and very addictive :) The
> more painful it is, when it fails for some reason. I was very impressed
> with completions for gnu arch commands. And now I'm trying out darcs,
> but seems like here completion is not so good. I'd rather say it hinders
> me instead of helping. The very first thing I try to do is to add a
> file. So I do 'darcs add f<Tab>'. All I get in response is "Completing
> `arg for darcs command'". No file name. So I have use copy/paste to get
> file names into command line.
> 
> What could be the problem here? Any solutions?

Oops. Sorry for noise. I've found the answer already on the darcs wiki.
I just need to type ./f<Tab> to get it working.

-- 
Minds, like parachutes, function best when open


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

* Re: completion for darcs
  2005-04-01  8:09 ` Andrei A. Voropaev
@ 2005-04-01  9:32   ` Antoine Calando
  2005-04-01 12:36     ` Dominic Mitchell
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Antoine Calando @ 2005-04-01  9:32 UTC (permalink / raw)
  To: zsh-users

Andrei A. Voropaev wrote:
> On Fri, Apr 01, 2005 at 10:06:20AM +0200, Andrei A. Voropaev wrote:
> 
>>Hello!
>>
>>System of completion in zsh is very powerful and very addictive :) The
>>more painful it is, when it fails for some reason. I was very impressed
>> ...
>>What could be the problem here? Any solutions?
> 
> 
> Oops. Sorry for noise. I've found the answer already on the darcs wiki.
> I just need to type ./f<Tab> to get it working.
> 

I also have, sometimes, this kind of problem. Would it be possible to
add a ZLE widget like "file-complete" (that would be bound, for instance,
to Ctrl-Tab) which forces the completion to happen in a "basic" way, rather
than with the new functions-customized system? It is very annoying to have
to type a full filename...

Or may be such a widget already exists?

Antoine


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

* Re: completion for darcs
  2005-04-01  9:32   ` Antoine Calando
@ 2005-04-01 12:36     ` Dominic Mitchell
  2005-04-01 13:18       ` Antoine Calando
  2005-04-01 12:56     ` J
  2005-04-01 13:32     ` Peter Stephenson
  2 siblings, 1 reply; 12+ messages in thread
From: Dominic Mitchell @ 2005-04-01 12:36 UTC (permalink / raw)
  To: Antoine Calando; +Cc: zsh-users

On Fri, Apr 01, 2005 at 11:32:28AM +0200, Antoine Calando wrote:
> I also have, sometimes, this kind of problem. Would it be possible to
> add a ZLE widget like "file-complete" (that would be bound, for instance,
> to Ctrl-Tab) which forces the completion to happen in a "basic" way, rather
> than with the new functions-customized system? It is very annoying to have
> to type a full filename...
> 
> Or may be such a widget already exists?

I don't know whether one exists or not, but you probably won't be able
to bind to Ctrl-Tab.  On all the terminals I have lying around, it
produces a plain tab for zsh to see.

-Dom


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

* Re: completion for darcs
  2005-04-01  9:32   ` Antoine Calando
  2005-04-01 12:36     ` Dominic Mitchell
@ 2005-04-01 12:56     ` J
  2005-04-01 13:32     ` Peter Stephenson
  2 siblings, 0 replies; 12+ messages in thread
From: J @ 2005-04-01 12:56 UTC (permalink / raw)
  To: Antoine Calando; +Cc: zsh-users

> I also have, sometimes, this kind of problem. Would it be possible to
> add a ZLE widget like "file-complete" (that would be bound, for instance,
> to Ctrl-Tab) which forces the completion to happen in a "basic" way, rather
> than with the new functions-customized system? It is very annoying to have
> to type a full filename...
> 
> Or may be such a widget already exists?

I suppose _bash_complete-word and _bash_list-choices may be about what
you're searching for. Look them up in the manual to see how they're
used, for they have a somewhat special behaviour with respect to the
binding.

-- 
J


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

* Re: completion for darcs
  2005-04-01 12:36     ` Dominic Mitchell
@ 2005-04-01 13:18       ` Antoine Calando
  2005-04-01 21:37         ` Sami Samhuri
  2005-04-05  7:29         ` Frederik Eaton
  0 siblings, 2 replies; 12+ messages in thread
From: Antoine Calando @ 2005-04-01 13:18 UTC (permalink / raw)
  To: Dominic Mitchell; +Cc: zsh-users

Dominic Mitchell wrote:
 > I don't know whether one exists or not, but you probably won't be able
 > to bind to Ctrl-Tab.  On all the terminals I have lying around, it
 > produces a plain tab for zsh to see.

With X, It is possible by adding some modifications in .Xdefaults:

*VT100.Translations:    #override\
     Shift ~Ctrl ~Meta<Key> BackSpace: string("\033[40;2~") \n

With the Linux console, you have to modify files used by loadkey.

I configured my system to use ctrl+arrows to move cursor from word
to word, or ctrl+backspace to delete a full word... it is very handy
and I don't have to remember all that prehistoric shortcuts from
vi/emacs ;-)

Antoine


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

* Re: completion for darcs
  2005-04-01  9:32   ` Antoine Calando
  2005-04-01 12:36     ` Dominic Mitchell
  2005-04-01 12:56     ` J
@ 2005-04-01 13:32     ` Peter Stephenson
  2005-04-01 13:51       ` Peter Stephenson
  2 siblings, 1 reply; 12+ messages in thread
From: Peter Stephenson @ 2005-04-01 13:32 UTC (permalink / raw)
  To: zsh-users

Antoine Calando wrote:
> I also have, sometimes, this kind of problem. Would it be possible to
> add a ZLE widget like "file-complete" (that would be bound, for instance,
> to Ctrl-Tab) which forces the completion to happen in a "basic" way, rather
> than with the new functions-customized system? It is very annoying to have
> to type a full filename...
> 
> Or may be such a widget already exists?

You can actually use the flexibility of the style system and the
_generic widget to do this.

zle -C complete-file complete-word _generic
zstyle ':completion:complete-file::::' completer _files
bindkey '^xF' complete-file

This defines a new widget called "complete-word".  The completer style
in the appropriate context is set to _files, so when invoked it simply
completes file names.  Then it's bound to \C-xF.

There are infinite variations on this.  If you have "From Bash to Zsh",
see pages 405 to 407.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: completion for darcs
  2005-04-01 13:32     ` Peter Stephenson
@ 2005-04-01 13:51       ` Peter Stephenson
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Stephenson @ 2005-04-01 13:51 UTC (permalink / raw)
  To: zsh-users

Peter Stephenson wrote:
> zle -C complete-file complete-word _generic
> zstyle ':completion:complete-file::::' completer _files
> bindkey '^xF' complete-file
> 
> This defines a new widget called "complete-word".

I meant "complete-file", of course.

pws


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: completion for darcs
  2005-04-01 13:18       ` Antoine Calando
@ 2005-04-01 21:37         ` Sami Samhuri
  2005-04-05  7:29         ` Frederik Eaton
  1 sibling, 0 replies; 12+ messages in thread
From: Sami Samhuri @ 2005-04-01 21:37 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

* On Fri Apr-01-2005 at 03:18:48 PM +0200, Antoine Calando said:
[...]
> ... it is very handy
> and I don't have to remember all that prehistoric shortcuts from
> vi/emacs ;-)

Blasphemy! What is this an April Fool's joke?! :)

-- 
Sami Samhuri

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: completion for darcs
  2005-04-01 13:18       ` Antoine Calando
  2005-04-01 21:37         ` Sami Samhuri
@ 2005-04-05  7:29         ` Frederik Eaton
  2005-04-05 14:40           ` Bart Schaefer
  1 sibling, 1 reply; 12+ messages in thread
From: Frederik Eaton @ 2005-04-05  7:29 UTC (permalink / raw)
  To: Antoine Calando; +Cc: Dominic Mitchell, zsh-users

Shouldn't it be possible to just tell zsh that when there are no
completions for an argument, it should fall back to completing files?

There are indeed many commands where I find that "smart" completion is
a nuisance. This wouldn't solve the problem for all of them, but it
would go a long way. I really don't like completion definitions that,
for instance, only let me complete files matching *.mp3. Maybe a
separate key binding for 'complete files', as is being discussed, is
still the correct solution, I don't know, but it would be nice if some
standard key binding were available in the default configuration.

Frederik

On Fri, Apr 01, 2005 at 03:18:48PM +0200, Antoine Calando wrote:
> Dominic Mitchell wrote:
> > I don't know whether one exists or not, but you probably won't be able
> > to bind to Ctrl-Tab.  On all the terminals I have lying around, it
> > produces a plain tab for zsh to see.
> 
> With X, It is possible by adding some modifications in .Xdefaults:
> 
> *VT100.Translations:    #override\
>     Shift ~Ctrl ~Meta<Key> BackSpace: string("\033[40;2~") \n
> 
> With the Linux console, you have to modify files used by loadkey.
> 
> I configured my system to use ctrl+arrows to move cursor from word
> to word, or ctrl+backspace to delete a full word... it is very handy
> and I don't have to remember all that prehistoric shortcuts from
> vi/emacs ;-)
> 
> Antoine
> 

-- 
http://ofb.net/~frederik/


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

* Re: completion for darcs
  2005-04-05  7:29         ` Frederik Eaton
@ 2005-04-05 14:40           ` Bart Schaefer
  2005-04-05 14:58             ` Andrei A. Voropaev
  0 siblings, 1 reply; 12+ messages in thread
From: Bart Schaefer @ 2005-04-05 14:40 UTC (permalink / raw)
  To: frederik; +Cc: zsh-users

On Apr 5, 12:29am, Frederik Eaton wrote:
}
} Shouldn't it be possible to just tell zsh that when there are no
} completions for an argument, it should fall back to completing files?

Sure.  And it is.  I'm surprised no one has mentioned this yet.  Just
put "_files" directly into your "completer" zstyle somewhere.  E.g.:

zstyle ':completion:*' completer \
    _oldlist _expand _complete _match _ignored _files _approximate _prefix

Where you place it will determine the precedence taken by file completion
with respect to "repairs" (like partial and approximate matching) done on
the completions suggested by the more context-specific completer selected
by _complete.


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

* Re: completion for darcs
  2005-04-05 14:40           ` Bart Schaefer
@ 2005-04-05 14:58             ` Andrei A. Voropaev
  0 siblings, 0 replies; 12+ messages in thread
From: Andrei A. Voropaev @ 2005-04-05 14:58 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: frederik, zsh-users

On Tue, Apr 05, 2005 at 02:40:10PM +0000, Bart Schaefer wrote:
> On Apr 5, 12:29am, Frederik Eaton wrote:
> }
> } Shouldn't it be possible to just tell zsh that when there are no
> } completions for an argument, it should fall back to completing files?
> 
> Sure.  And it is.  I'm surprised no one has mentioned this yet.  Just
> put "_files" directly into your "completer" zstyle somewhere.  E.g.:
> 
> zstyle ':completion:*' completer \
>     _oldlist _expand _complete _match _ignored _files _approximate _prefix
> 
> Where you place it will determine the precedence taken by file completion
> with respect to "repairs" (like partial and approximate matching) done on
> the completions suggested by the more context-specific completer selected
> by _complete.

Yahoo! :) Works perfectly :)

-- 
Minds, like parachutes, function best when open


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

end of thread, other threads:[~2005-04-05 15:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-01  8:06 completion for darcs Andrei A. Voropaev
2005-04-01  8:09 ` Andrei A. Voropaev
2005-04-01  9:32   ` Antoine Calando
2005-04-01 12:36     ` Dominic Mitchell
2005-04-01 13:18       ` Antoine Calando
2005-04-01 21:37         ` Sami Samhuri
2005-04-05  7:29         ` Frederik Eaton
2005-04-05 14:40           ` Bart Schaefer
2005-04-05 14:58             ` Andrei A. Voropaev
2005-04-01 12:56     ` J
2005-04-01 13:32     ` Peter Stephenson
2005-04-01 13:51       ` 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).