Wednesday, February 07, 2007

Linux keyboard and less

Just a quick note, because all I found on the web was wrong. One small episode in the Linux keyboard nightmare: how to use your PC keyboard's Home and End keys in less, so that it goes to the start and end of the file?

The fix:

cat >>/etc/lesskey <<END
#command
\e[1~ goto-line
\e[4~ goto-end
\e\e quit
END
lesskey -o /etc/less /etc/lesskey
export LESS="-k/etc/less"
echo export LESS="-k/etc/less" >>/etc/profile
This also adds a double-escape to quit.

Labels: , , , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home