From: pete cervasio (pete@q106fm.uucp)
Date: 04/14/93


From: pete@q106fm.uucp (pete cervasio)
Subject: Re: A modified LESS to accept arrow keys
Date: Wed, 14 Apr 1993 18:05:42 CDT


[sent in email, and posted here in case anyone else needs the info]

aehall@calvin.seattleu.edu (root-bound) writes:

> I've modified the source of LESS to accept up/down arrows, pgup/pgdn,
> and home/end from the PC keyboard.
>
> If anyone's interested, I can upload it (ftp) somewhere.

Why?? Use the lesskey program and the following input file like this:
    lesskey < lesskey.input

lesskey creates a file called .less in your home directory. Try "man
lesskey" for info about it. Maybe even "man less".

=====8<=====8<=====lesskey.input=====8<=====8<=====
^[[B forw-line
^[[A back-line
^[[6~ forw-screen
^[[5~ back-screen
^[[1~ goto-line
^[[4~ goto-end
^[[D prev-file
^[[C next-file
=====8<=====8<=====lesskey.input=====8<=====8<=====

Make sure the ^[ is an esc character. You can create one of these files
with emacs by typing control-q before typing the key you want.

i.e.: <C-q><downarrow><tab>forw-line<enter>
      <C-q><uparrow><tab>back-line<enter>

and so forth and so on. It's very easy doing it this way, and people
that call in to your system with different terminal types can create
their own .less files that work with their terminals. No need to
recompile the darn thing.

Besides, if you get a newer version of less, it should see your key
mappings automagically... :-)

Pete C.

+----------------------------------------------------------------------+
| Pete Cervasio | pete%q106fm.uucp@wupost.wustl.edu |
| I fish, therefore I am. | pete.cervasio@f1.n2250.z1.fidonet.org |
+----------------------------------------------------------------------+
| If you think of C as a preprocessor for your assembler, it makes |
| just as little sense as before. (me) |
+----------------------------------------------------------------------+