zsh-users
 help / color / mirror / code / Atom feed
* bindkey intro?
@ 1997-09-26  5:27 chutzpah
  1997-09-26  8:07 ` Matthias Kopfermann
  1997-09-26  8:23 ` Louis-David Mitterrand
  0 siblings, 2 replies; 4+ messages in thread
From: chutzpah @ 1997-09-26  5:27 UTC (permalink / raw)
  To: zsh-users

	okay, so i've been using zsh for a couple of years now, and i know that
i've been barely scratching the surface of what it (or any other shell) can
do.  so i've decided to actually dig in and start _doing_ things with the
shell, starting with bindkey, which i've seen lots about but never actually
used.
	i'm assuming that bindkey is what i would use to do the following
extremely trivial task, for example, but have no idea how to do so: i'd
like to be able to map the control+(left arrow) and control+(right arrow)
keys to the sequences "ESC-b" and "ESC-w", respectively (so that, with
VISUAL set to 'vi', they move the cursor one word to the left/right.
	so where would i go about figuring out how to do this in bindkey?  is
there a faq?  i couldn't find a man page, though that could just be the
fault of the poor man pages on my server.

	tia,
	sweth.



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

* Re: bindkey intro?
  1997-09-26  5:27 bindkey intro? chutzpah
@ 1997-09-26  8:07 ` Matthias Kopfermann
  1997-09-26  8:12   ` Matthias Kopfermann
  1997-09-26  8:23 ` Louis-David Mitterrand
  1 sibling, 1 reply; 4+ messages in thread
From: Matthias Kopfermann @ 1997-09-26  8:07 UTC (permalink / raw)
  To: chutzpah; +Cc: zsh-users

> i would
> like to be able to map the control+(left arrow) and control+(right arrow)
> keys to the sequences "ESC-b" and "ESC-w", respectively (so that, with
> VISUAL set to 'vi', they move the cursor one word to the left/right.
> 	so where would i go about figuring out how to do this in bindkey?  is
> there a faq?  i couldn't find a man page, though that could just be the
> fault of the poor man pages on my server.
 i don't know how to do that in command -mode, i can only try to do it
 in vi-insert-mode.
 bindkey -s "control-v and then control( pressed" "control-v ESC pressed then b" 
control-v is for quoting ESC in ed/sed/vi thinking.

 my question is, can i map commands to the so called
 command-mode or is it only possible in insert-mode for bindkey -v
?

-- 
Matthias

(this message came from Hamburg/Germany)


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

* Re: bindkey intro?
  1997-09-26  8:07 ` Matthias Kopfermann
@ 1997-09-26  8:12   ` Matthias Kopfermann
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Kopfermann @ 1997-09-26  8:12 UTC (permalink / raw)
  To: Matthias Kopfermann; +Cc: sweth, zsh-users

> 
> > i would
> > like to be able to map the control+(left arrow) and control+(right arrow)
> > keys to the sequences "ESC-b" and "ESC-w", respectively (so that, with
> > VISUAL set to 'vi', they move the cursor one word to the left/right.
>  bindkey -s "control-v and then control( pressed" "control-v ESC pressed,
  then b" 
> control-v is for quoting ESC in ed/sed/vi thinking.
wrong, Matthias! :-)
 bindkey -s does print everything to the screen.
you need to use bindkey but i don't know how to do that right now.


-- 
Matthias

(this message came from Hamburg/Germany)


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

* Re: bindkey intro?
  1997-09-26  5:27 bindkey intro? chutzpah
  1997-09-26  8:07 ` Matthias Kopfermann
@ 1997-09-26  8:23 ` Louis-David Mitterrand
  1 sibling, 0 replies; 4+ messages in thread
From: Louis-David Mitterrand @ 1997-09-26  8:23 UTC (permalink / raw)
  To: zsh-users

On Fri, Sep 26, 1997 at 01:27:04AM -0400, chutzpah wrote:
> 	okay, so i've been using zsh for a couple of years now, and i know that
> i've been barely scratching the surface of what it (or any other shell) can
> do.  so i've decided to actually dig in and start _doing_ things with the
> shell, starting with bindkey, which i've seen lots about but never actually
> used.
> 	i'm assuming that bindkey is what i would use to do the following
> extremely trivial task, for example, but have no idea how to do so: i'd
> like to be able to map the control+(left arrow) and control+(right arrow)
> keys to the sequences "ESC-b" and "ESC-w", respectively (so that, with
> VISUAL set to 'vi', they move the cursor one word to the left/right.
> 	so where would i go about figuring out how to do this in bindkey?  is
> there a faq?  i couldn't find a man page, though that could just be the
> fault of the poor man pages on my server.

bindkey "^[[32$" backward-word
bindkey "^[[33$" forward-word

the second argument being the codes sent by the key you choose. Try
CTRL-V + <your key> at the command-line to check the codes.

-- 

     Louis-David Mitterrand
     http://www.aparima.com/F1/
     mito@aparima.com


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

end of thread, other threads:[~1997-09-26  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-26  5:27 bindkey intro? chutzpah
1997-09-26  8:07 ` Matthias Kopfermann
1997-09-26  8:12   ` Matthias Kopfermann
1997-09-26  8:23 ` Louis-David Mitterrand

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