zsh-users
 help / color / mirror / code / Atom feed
* zle questions
@ 2000-03-30 10:02 jean-baptiste.marchand
  0 siblings, 0 replies; 2+ messages in thread
From: jean-baptiste.marchand @ 2000-03-30 10:02 UTC (permalink / raw)
  To: zsh-users

Hi,

I've been using zsh-3.1.6 since a few weeks. I've two questions about
everyday usage :

1)

I like the menu completion feature (not complist) but I've still
haven't found how to stop the completion when I've found the file I'm
interested in :

mylogin@mymachine ~> ls /

then TAB 

and zsh cycles trough the directories of /

If I choose /usr, I would like to hit a key to tell zsh to stop the
completion, put /usr/ on the command-line and continue the menu
completion in /usr

I thought the zle function accept-and-menu-complete could do the job
but instead, it inserts the current completion followed by a space...

2) Is it possible in zle to specify word boundaries when using
   backward-kill-word ?

In GNU Bash, you can do the following :

mylogin@mymachine ~> ls /usr/X11R6/bin 

and if you want to execute 'ls' in '/usr/X11R6/' instead of
'/usr/X11R6/bin', you would hit ^W and it would kill the word '/bin'.
Instead, Zsh kills the whole '/usr/X11R6/bin'. It is because GNU Bash
recognizes '/' as a word boundary by default.

I found this feature quite interesting but maybe there is another way
to do this easily. 

Thanks for your help.

Jean-Baptiste Marchand
-- 
Jean-Baptiste.Marchand@epita.fr
Real Unix Books are written with Troff
(W. Richard Stevens)


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

* Re: zle questions
@ 2000-03-30 10:38 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-03-30 10:38 UTC (permalink / raw)
  To: zsh-users


jean-baptiste.marchand wrote:

> 1)
> 
> I like the menu completion feature (not complist) but I've still
> haven't found how to stop the completion when I've found the file I'm
> interested in :
> 
> mylogin@mymachine ~> ls /
> 
> then TAB 
> 
> and zsh cycles trough the directories of /
> 
> If I choose /usr, I would like to hit a key to tell zsh to stop the
> completion, put /usr/ on the command-line and continue the menu
> completion in /usr

You just hit whatever key you want (`/' in this case) and that will
stop menucompletion. The `/' is this example is a bit magic (with the
AUTO_REMOVE_SLASH option set): if the completion code automatically
inserted the trailing `/' (as it normally does) and you hit `/' this
doesn't seem to change the command line. But what really happens is
that `/' is one of the characters that automatically remove the
inserted slash and then self-insert inserts it again.

> I thought the zle function accept-and-menu-complete could do the job
> but instead, it inserts the current completion followed by a space...
> 
> 2) Is it possible in zle to specify word boundaries when using
>    backward-kill-word ?
> 
> In GNU Bash, you can do the following :
> 
> mylogin@mymachine ~> ls /usr/X11R6/bin 
> 
> and if you want to execute 'ls' in '/usr/X11R6/' instead of
> '/usr/X11R6/bin', you would hit ^W and it would kill the word '/bin'.
> Instead, Zsh kills the whole '/usr/X11R6/bin'. It is because GNU Bash
> recognizes '/' as a word boundary by default.
> 
> I found this feature quite interesting but maybe there is another way
> to do this easily. 

The zle widgets for word movement/killing/whatever should all use the
$WORDCHARS special parameter. That gives the characters that are
normally considered to be part of a word (sans the alphanumeric ones
which are always considered to be part of words) -- and normally it
contains the slash. So you can just remove all characters from
$WORDCHARS where you want the cursor to be moved to or where you want
the word killing function to kill to.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2000-03-30 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-30 10:02 zle questions jean-baptiste.marchand
2000-03-30 10:38 Sven Wischnowsky

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