Configure keybindings for the less command using a configuration file. The input file defaults to ˜/.lesskey and the output file to ˜/.less unless you specify otherwise.
The configuration file for lesskey has one to three sections. These are marked by a line containing a # symbol and the name of the section: #command, #line-edit, and #env.
The command section determines the keys used for actions within less. Each line should contain the key or key combination you wish to define, a space or tab, and the name of the action to perform. You may also add an extra string at the end, which will be performed at the end of the first action.
Keys you define should be entered as you plan to type them, with the following exceptions:
|Up arrow: \ku|
|Down arrow: \kd|
|Right arrow: \kr|
|Left arrow: \kl|
|Page up: \kU|
|Page down: \kD|
The actions that can be defined are:
|invalid (creates error)|