less
已经将j/k用于垂直滚动,而h/l用于水平滚动(在--ch
模式下)。L键和任何东西都没有关系,而H只是H的同义词,所以我不会覆盖任何重要的绑定。
我怎样才能使H和L水平滚动?
发布于 2012-12-22 13:32:10
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
生成一个轻量级文件,读取man lesskey
填充细节。您可以将以下内容放入减键输入文件(默认情况下为~/.lesskey
)
h left-scroll
l right-scroll
然后运行lesskey
,它将为您生成一个输出文件(默认情况下是~/.less
)。
据我所知,你不能按字符水平滚动。
发布于 2012-12-22 14:37:09
您可以使用lesskey
程序设置自己的键绑定。在包含键绑定的主目录中创建一个名为.lesskey
的文件,然后运行lesskey
命令将其转换为less
理解的表单(编译后的绑定存储在~/.less
中)。
没有命令滚动一个字符左或右。您可以通过将数值参数1传递给left-scroll
和right-scroll
命令来做到这一点。不能直接为带有参数的命令设置绑定,但可以设置绑定以运行命令,然后解析更多的键。因此,运行noaction
命令,然后解析一个带所需参数运行滚动命令的键序列。
h noaction 1\e(
l noaction 1\e)
https://unix.stackexchange.com/questions/59188
复制相似问题