Commit | Line | Data |
---|---|---|
77e25d77 WJ |
1 | .TH LESSKEY 1 |
2 | .SH NAME | |
3 | lesskey \- specify key bindings for less | |
4 | .SH SYNOPSIS | |
5 | .B "lesskey [-o output] [input]" | |
6 | .SH DESCRIPTION | |
7 | .I Lesskey | |
8 | is used to specify a set of key bindings to be used by | |
9 | .I less. | |
10 | The input file is a text file which describes the key bindings, | |
11 | and the output file is a binary file which is used by | |
12 | .I less. | |
13 | If no input file is specified, standard input is used. | |
14 | If no output file is specified, $HOME/.less is used. | |
15 | .PP | |
16 | The input file consists of lines of the form: | |
17 | .sp | |
18 | string <whitespace> action [extra-string] <newline> | |
19 | .sp | |
20 | Whitespace is any sequence of one or more spaces and/or tabs. | |
21 | The "string" is the command key(s) which invoke the action. | |
22 | The string may be a single command key, or a sequence of up to 15 keys. | |
23 | The "action" is the name of the less action, from the list below. | |
24 | The characters in the "string" may appear literally, or be | |
25 | prefixed by a carat to indicate a control key. | |
26 | A backslash may be used to cause the following character | |
27 | to be taken literally. | |
28 | Characters which must be preceded by backslash include | |
29 | carat, space, tab and the backslash itself. | |
30 | A backslash followed by one to three octal digits may be used to | |
31 | specify a character by its octal value. | |
32 | Blank lines and lines which start with a pound sign (#) are ignored. | |
33 | .PP | |
34 | An action may be followed by an extra string. | |
35 | This string is parsed after the command is entered, | |
36 | just as if it were entered on the command line. | |
37 | This feature can be used in certain cases to extend | |
38 | the functionality of a command. | |
39 | For example, these entries would create a pair of commands | |
40 | to turn on/off line numbers using | |
41 | .I vi | |
42 | syntax: | |
43 | .sp | |
44 | .nf | |
45 | :set\\ nu toggle-option -N | |
46 | :set\\ nonu toggle-option +N | |
47 | .fi | |
48 | .sp | |
49 | See also the ":ta" command in the example below. | |
50 | ||
51 | .SH EXAMPLE | |
52 | The following input file describes the set of | |
53 | default command keys used by less: | |
54 | .sp | |
55 | .nf | |
56 | r forw-line | |
57 | n forw-line | |
58 | e forw-line | |
59 | j forw-line | |
60 | ^E forw-line | |
61 | ^N forw-line | |
62 | k back-line | |
63 | y back-line | |
64 | ^Y back-line | |
65 | ^K back-line | |
66 | ^P back-line | |
67 | J forw-line-force | |
68 | K back-line-force | |
69 | Y back-line-force | |
70 | d forw-scroll | |
71 | ^D forw-scroll | |
72 | u back-scroll | |
73 | ^U back-scroll | |
74 | ' back-scroll | |
75 | \e40 forw-screen | |
76 | f forw-screen | |
77 | ^F forw-screen | |
78 | ^V forw-screen | |
79 | b back-screen | |
80 | ^B back-screen | |
81 | \e33v back-screen | |
82 | z forw-window | |
83 | w back-window | |
84 | F forw-forever | |
85 | R repaint-flush | |
86 | r repaint | |
87 | ^R repaint | |
88 | ^L repaint | |
89 | g goto-line | |
90 | < goto-line | |
91 | \e33< goto-line | |
92 | p percent | |
93 | % percent | |
94 | { forw-bracket {} | |
95 | } back-bracket {} | |
96 | ( forw-bracket () | |
97 | ) back-bracket () | |
98 | [ forw-bracket [] | |
99 | ] back-bracket [] | |
100 | \e33^F forw-bracket | |
101 | \e33^B back-bracket | |
102 | G goto-end | |
103 | \e33> goto-end | |
104 | > goto-end | |
105 | P goto-end | |
106 | = status | |
107 | ^G status | |
108 | :f status | |
109 | / forw-search | |
110 | ? back-search | |
111 | \e33/ forw-search * | |
112 | \e33? back-search * | |
113 | n repeat-search | |
114 | \e33n repeat-search-all | |
115 | N reverse-search | |
116 | \e33N reverse-search-all | |
117 | m set-mark | |
118 | ' goto-mark | |
119 | ^X^X goto-mark | |
120 | E examine | |
121 | :e examine | |
122 | ^X^V examine | |
123 | :n next-file | |
124 | :p prev-file | |
125 | :x index-file | |
126 | - toggle-option | |
127 | :t toggle-option t | |
128 | s toggle-option o | |
129 | _ display-option | |
130 | | pipe | |
131 | v visual | |
132 | ! shell | |
133 | + firstcmd | |
134 | H help | |
135 | h help | |
136 | V version | |
137 | q quit | |
138 | :q quit | |
139 | :Q quit | |
140 | ZZ quit | |
141 | \e33\e33 quit | |
142 | .fi | |
143 | .sp | |
144 | Commands specified by | |
145 | .I lesskey | |
146 | take precedence over the default commands. | |
147 | A default command key may be disabled by including it in the | |
148 | key file with the action "invalid". | |
149 | ||
150 | .SH "SEE ALSO" | |
151 | less(1) |