[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: key bindings
From: |
Phil!Gregory |
Subject: |
Re: key bindings |
Date: |
Mon, 19 Jul 2004 23:35:34 -0400 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
* Zenaan Harkness <address@hidden> [2004-07-20 08:42 +1000]:
My, you seem to have a lot of questions. Fortunately for you, they all
seem moderatly interesting/hard to find and I have some free time, so I'll
do my best to answer them. (I'm sure you did your googling and
documentation-reading anyway, right? (Actually, I can see that you've
definitely been reading documentation.))
> I don't undestand the above - if "bindkey -d" is an example keybinding,
> then what key would I press to "Show all of the default key bindings".
> Or is there some place I can type "bindkey -d" to get this list?
Screen has a command line, of sorts. Just type
C-a :
and then you can enter any screen command, including 'bindkey -d'. If you
wanted to bind it to a key (which is probably silly; 'C-a ?' should be
sufficient for everyday use) you could use, say, the command
bindkey -k k1 bindkey -d
> This seems arbitrary. To have a code "k?" for fn keys 1 to 10, and F?
> being 11 and 12 - like, why?! I hope there is some higher principle than
> that of consistency at work here.
As the manpage says, -k uses termcap keynames. It so happens that, for
historical reasons, termcap uses k? for 1-10 and F? for 11-63. (Yes, 63.
It goes F1-F9,FA-FZ,Fa-Fr.) termcap has grown up over a long period of
time and is now rather crufty, but it is a standard that a lot of people
know, so it's not unreasonable for screen to use its key definitions.
> Is it possible to do something like:
>
> bindkey -d -k ^PgUp previous
> bindkey -d -k ^PgDn next
Hm. I don't see a way to do this with the termcap codes, since I don't
see one for Ctrl-PgUp. The hackish approach is to do something like
'cat > /dev/null' then press C-v and the key conbination to see what
characters your terminal sends for that key. (My gnome-terminal seems to
send ^[[5;5~ for C-PgUp and ^[[6;5~ for C-PgDn.) Then you just use
bindkey to capture that key sequence:
bindkey ^[[5;5~ previous
* Zenaan Harkness <address@hidden> [2004-07-20 09:48 +1000]:
> I also want to bind HOME and END to go to start and end of command line.
There are termcap codes for this. 'man 5 termcap' tells me that they are
kh for Home and @7 for End.
> Typing CTRL-a a gets a little tedious.
Indeed. This is why many people rebind the escape key to something they
use less often. I have mine set to C-z.
--
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2 print: D200 5BDB FC4B B24A 9248 9F7A 4322 2D22 026A 27F2
--- --
Show me an Ethernet collision and I'll show you a network that could do
with one user fewer.
-- The BOFH
---- --- --
Re: key bindings, Zenaan Harkness, 2004/07/20