Answers:
man less
告诉我们以下内容:
You may define your own less commands by using the program lesskey
(1) to create a lesskey file. This file specifies a set of command
keys and an action associated with each key. You may also use
lesskey to change the line-editing keys (see LINE EDITING), and to
set environment variables. If the environment variable LESSKEY is
set, less uses that as the name of the lesskey file. Otherwise,
less looks in a standard place for the lesskey file: On Unix
systems, less looks for a lesskey file called "$HOME/.less".
它告诉我们使用lesskey
生成一个lesskey文件读取man lesskey
详细信息。您可以将以下内容放入lesskey输入文件中(~/.lesskey
默认情况下)
h left-scroll
l right-scroll
然后运行lesskey
,它将~/.less
为您生成一个输出文件(默认情况下)。
据我所知,您不能逐字符水平滚动。
您可以使用该lesskey
程序设置自己的键绑定。.lesskey
在主目录中创建一个包含键绑定的文件,然后运行lesskey
命令将其转换为less
可理解的格式(已编译的绑定存储在中~/.less
)。
没有命令向左或向右滚动一个字符。您可以通过将数字参数1传递给left-scroll
and right-scroll
命令来实现。您不能直接为带有参数的命令设置绑定,但是可以设置绑定以运行命令,然后解析更多键。因此,运行noaction
命令,然后解析一个键序列,该键序列将使用所需的参数运行scroll命令。
h noaction 1\e(
l noaction 1\e)
man lesskey