Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bindkey + PageUp/PageDown keys



Oliver Grimm <grimm@xxxxxxxxxxxxxxxxxxxxx> typed:
:I'd like to assign some operations like, e.g.,  vi-beginning-of-line 
:to the special keys PageUp, PageDown, Home etc.
:But I don't seem to understand the correct behaviour of the
:bindkey command. Whereas I got with 'bindkey -s a b' the expected
:behaviour, I don't know how to apply this to these special keys.
:In xterm, they are called 'Prior', 'Next', etc. but how do I use
:this with bindkey ?

Your terminal emulator (xterm) will translate the Prior (PageUp)
and Next (PageDown) keys into a character sequence - usually an
escape sequence (i.e. the first character in the sequence is an
escape character).  Do a normal bindkey command however you may
need to make zsh quote the first character.

% bindkey '<CTRL-V><PageUp>' vi-beginning-of-line

and you should see something like:

% bindkey '^[[5~' vi-beginning-of-line

You don't want the -s flag to bindkey here since you want to
execute a command.

Regards,
-- 
Geoff Wing : <gcw@xxxxxxxxx>
Rxvt Stuff : <gcw@xxxxxxxx>
Zsh Stuff  : <gcw@xxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author