Less
如何以更少的成本設置 hjkl?
less
已經使用 j/k 進行垂直滾動,但沒有使用 h/l 進行水平滾動(在--ch
模式下)。l 鍵無論如何都沒有綁定到任何東西,而 h 只是 H 的同義詞,所以我不會覆蓋任何重要的綁定。如何使 h 和 l 水平滾動?
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
為你生成一個輸出文件(預設)。據我所知,您不能逐個字元地進行水平滾動。