login
Header Space

 
 

Re: A modified LESS to accept arrow keys

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, April 14, 1993 - 7:05 pm

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

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


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)             |
+----------------------------------------------------------------------+
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: A modified LESS to accept arrow keys, pete cervasio, (Wed Apr 14, 7:05 pm)
speck-geostationary