xref: /netbsd/external/bsd/less/dist/less.hlp (revision 0a7fbd90)
1bd4fcc09Stron
2bd4fcc09Stron                   SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
3bd4fcc09Stron
4bd4fcc09Stron      Commands marked with * may be preceded by a number, _N.
5bd4fcc09Stron      Notes in parentheses indicate the behavior if _N is given.
6*0a7fbd90Stron      A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
7bd4fcc09Stron
8bd4fcc09Stron  h  H                 Display this help.
9bd4fcc09Stron  q  :q  Q  :Q  ZZ     Exit.
10bd4fcc09Stron ---------------------------------------------------------------------------
11bd4fcc09Stron
12bd4fcc09Stron                           MMOOVVIINNGG
13bd4fcc09Stron
14bd4fcc09Stron  e  ^E  j  ^N  CR  *  Forward  one line   (or _N lines).
15bd4fcc09Stron  y  ^Y  k  ^K  ^P  *  Backward one line   (or _N lines).
16bd4fcc09Stron  f  ^F  ^V  SPACE  *  Forward  one window (or _N lines).
17bd4fcc09Stron  b  ^B  ESC-v      *  Backward one window (or _N lines).
18bd4fcc09Stron  z                 *  Forward  one window (and set window to _N).
19bd4fcc09Stron  w                 *  Backward one window (and set window to _N).
20bd4fcc09Stron  ESC-SPACE         *  Forward  one window, but don't stop at end-of-file.
21bd4fcc09Stron  d  ^D             *  Forward  one half-window (and set half-window to _N).
22bd4fcc09Stron  u  ^U             *  Backward one half-window (and set half-window to _N).
23bd4fcc09Stron  ESC-)  RightArrow *  Left  one half screen width (or _N positions).
24bd4fcc09Stron  ESC-(  LeftArrow  *  Right one half screen width (or _N positions).
25bd4fcc09Stron  F                    Forward forever; like "tail -f".
26bd4fcc09Stron  r  ^R  ^L            Repaint screen.
27bd4fcc09Stron  R                    Repaint screen, discarding buffered input.
28bd4fcc09Stron        ---------------------------------------------------
29bd4fcc09Stron        Default "window" is the screen height.
30bd4fcc09Stron        Default "half-window" is half of the screen height.
31bd4fcc09Stron ---------------------------------------------------------------------------
32bd4fcc09Stron
33bd4fcc09Stron                          SSEEAARRCCHHIINNGG
34bd4fcc09Stron
35bd4fcc09Stron  /_p_a_t_t_e_r_n          *  Search forward for (_N-th) matching line.
36bd4fcc09Stron  ?_p_a_t_t_e_r_n          *  Search backward for (_N-th) matching line.
37bd4fcc09Stron  n                 *  Repeat previous search (for _N-th occurrence).
38bd4fcc09Stron  N                 *  Repeat previous search in reverse direction.
39bd4fcc09Stron  ESC-n             *  Repeat previous search, spanning files.
40bd4fcc09Stron  ESC-N             *  Repeat previous search, reverse dir. & spanning files.
41bd4fcc09Stron  ESC-u                Undo (toggle) search highlighting.
42bd4fcc09Stron  &_p_a_t_t_e_r_n          *  Display only matching lines
43bd4fcc09Stron        ---------------------------------------------------
44*0a7fbd90Stron        A search pattern may be preceded by one or more of:
45bd4fcc09Stron        ^N or !  Search for NON-matching lines.
46bd4fcc09Stron        ^E or *  Search multiple files (pass thru END OF FILE).
47bd4fcc09Stron        ^F or @  Start search at FIRST file (for /) or last file (for ?).
48bd4fcc09Stron        ^K       Highlight matches, but don't move (KEEP position).
49bd4fcc09Stron        ^R       Don't use REGULAR EXPRESSIONS.
50bd4fcc09Stron ---------------------------------------------------------------------------
51bd4fcc09Stron
52bd4fcc09Stron                           JJUUMMPPIINNGG
53bd4fcc09Stron
54bd4fcc09Stron  g  <  ESC-<       *  Go to first line in file (or line _N).
55bd4fcc09Stron  G  >  ESC->       *  Go to last line in file (or line _N).
56bd4fcc09Stron  p  %              *  Go to beginning of file (or _N percent into file).
57bd4fcc09Stron  t                 *  Go to the (_N-th) next tag.
58bd4fcc09Stron  T                 *  Go to the (_N-th) previous tag.
59bd4fcc09Stron  {  (  [           *  Find close bracket } ) ].
60bd4fcc09Stron  }  )  ]           *  Find open bracket { ( [.
61bd4fcc09Stron  ESC-^F _<_c_1_> _<_c_2_>  *  Find close bracket _<_c_2_>.
62bd4fcc09Stron  ESC-^B _<_c_1_> _<_c_2_>  *  Find open bracket _<_c_1_>
63bd4fcc09Stron        ---------------------------------------------------
64bd4fcc09Stron        Each "find close bracket" command goes forward to the close bracket
65bd4fcc09Stron          matching the (_N-th) open bracket in the top line.
66bd4fcc09Stron        Each "find open bracket" command goes backward to the open bracket
67bd4fcc09Stron          matching the (_N-th) close bracket in the bottom line.
68bd4fcc09Stron
69bd4fcc09Stron  m_<_l_e_t_t_e_r_>            Mark the current position with <letter>.
70bd4fcc09Stron  '_<_l_e_t_t_e_r_>            Go to a previously marked position.
71bd4fcc09Stron  ''                   Go to the previous position.
72bd4fcc09Stron  ^X^X                 Same as '.
73bd4fcc09Stron        ---------------------------------------------------
74bd4fcc09Stron        A mark is any upper-case or lower-case letter.
75bd4fcc09Stron        Certain marks are predefined:
76bd4fcc09Stron             ^  means  beginning of the file
77bd4fcc09Stron             $  means  end of the file
78bd4fcc09Stron ---------------------------------------------------------------------------
79bd4fcc09Stron
80bd4fcc09Stron                        CCHHAANNGGIINNGG FFIILLEESS
81bd4fcc09Stron
82bd4fcc09Stron  :e [_f_i_l_e]            Examine a new file.
83bd4fcc09Stron  ^X^V                 Same as :e.
84bd4fcc09Stron  :n                *  Examine the (_N-th) next file from the command line.
85bd4fcc09Stron  :p                *  Examine the (_N-th) previous file from the command line.
86bd4fcc09Stron  :x                *  Examine the first (or _N-th) file from the command line.
87bd4fcc09Stron  :d                   Delete the current file from the command line list.
88bd4fcc09Stron  =  ^G  :f            Print current file name.
89bd4fcc09Stron ---------------------------------------------------------------------------
90bd4fcc09Stron
91bd4fcc09Stron                    MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS
92bd4fcc09Stron
93bd4fcc09Stron  -_<_f_l_a_g_>              Toggle a command line option [see OPTIONS below].
94bd4fcc09Stron  --_<_n_a_m_e_>             Toggle a command line option, by name.
95bd4fcc09Stron  __<_f_l_a_g_>              Display the setting of a command line option.
96bd4fcc09Stron  ___<_n_a_m_e_>             Display the setting of an option, by name.
97bd4fcc09Stron  +_c_m_d                 Execute the less cmd each time a new file is examined.
98bd4fcc09Stron
99bd4fcc09Stron  !_c_o_m_m_a_n_d             Execute the shell command with $SHELL.
100bd4fcc09Stron  |XX_c_o_m_m_a_n_d            Pipe file between current pos & mark XX to shell command.
101bd4fcc09Stron  v                    Edit the current file with $VISUAL or $EDITOR.
102bd4fcc09Stron  V                    Print version number of "less".
103bd4fcc09Stron ---------------------------------------------------------------------------
104bd4fcc09Stron
105bd4fcc09Stron                           OOPPTTIIOONNSS
106bd4fcc09Stron
107bd4fcc09Stron        Most options may be changed either on the command line,
108bd4fcc09Stron        or from within less by using the - or -- command.
109bd4fcc09Stron        Options may be given in one of two forms: either a single
110*0a7fbd90Stron        character preceded by a -, or a name preceded by --.
111bd4fcc09Stron
112bd4fcc09Stron  -?  ........  --help
113bd4fcc09Stron                  Display help (from command line).
114bd4fcc09Stron  -a  ........  --search-skip-screen
115*0a7fbd90Stron                  Search skips current screen.
116bd4fcc09Stron  -A  ........  --SEARCH-SKIP-SCREEN
117*0a7fbd90Stron                  Search starts just after target line.
118bd4fcc09Stron  -b [_N]  ....  --buffers=[_N]
119bd4fcc09Stron                  Number of buffers.
120bd4fcc09Stron  -B  ........  --auto-buffers
121bd4fcc09Stron                  Don't automatically allocate buffers for pipes.
122bd4fcc09Stron  -c  ........  --clear-screen
123bd4fcc09Stron                  Repaint by clearing rather than scrolling.
124bd4fcc09Stron  -d  ........  --dumb
125bd4fcc09Stron                  Dumb terminal.
126bd4fcc09Stron  -D [_x_n_._n]  .  --color=_x_n_._n
127bd4fcc09Stron                  Set screen colors. (MS-DOS only)
128bd4fcc09Stron  -e  -E  ....  --quit-at-eof  --QUIT-AT-EOF
129bd4fcc09Stron                  Quit at end of file.
130bd4fcc09Stron  -f  ........  --force
131bd4fcc09Stron                  Force open non-regular files.
132bd4fcc09Stron  -F  ........  --quit-if-one-screen
133bd4fcc09Stron                  Quit if entire file fits on first screen.
134bd4fcc09Stron  -g  ........  --hilite-search
135bd4fcc09Stron                  Highlight only last match for searches.
136bd4fcc09Stron  -G  ........  --HILITE-SEARCH
137bd4fcc09Stron                  Don't highlight any matches for searches.
138bd4fcc09Stron  -h [_N]  ....  --max-back-scroll=[_N]
139bd4fcc09Stron                  Backward scroll limit.
140bd4fcc09Stron  -i  ........  --ignore-case
141bd4fcc09Stron                  Ignore case in searches that do not contain uppercase.
142bd4fcc09Stron  -I  ........  --IGNORE-CASE
143bd4fcc09Stron                  Ignore case in all searches.
144bd4fcc09Stron  -j [_N]  ....  --jump-target=[_N]
145bd4fcc09Stron                  Screen position of target lines.
146bd4fcc09Stron  -J  ........  --status-column
147bd4fcc09Stron                  Display a status column at left edge of screen.
148bd4fcc09Stron  -k [_f_i_l_e]  .  --lesskey-file=[_f_i_l_e]
149bd4fcc09Stron                  Use a lesskey file.
150bd4fcc09Stron  -K            --quit-on-intr
151bd4fcc09Stron                  Exit less in response to ctrl-C.
152bd4fcc09Stron  -L  ........  --no-lessopen
153bd4fcc09Stron                  Ignore the LESSOPEN environment variable.
154bd4fcc09Stron  -m  -M  ....  --long-prompt  --LONG-PROMPT
155bd4fcc09Stron                  Set prompt style.
156bd4fcc09Stron  -n  -N  ....  --line-numbers  --LINE-NUMBERS
157bd4fcc09Stron                  Don't use line numbers.
158bd4fcc09Stron  -o [_f_i_l_e]  .  --log-file=[_f_i_l_e]
159bd4fcc09Stron                  Copy to log file (standard input only).
160bd4fcc09Stron  -O [_f_i_l_e]  .  --LOG-FILE=[_f_i_l_e]
161bd4fcc09Stron                  Copy to log file (unconditionally overwrite).
162bd4fcc09Stron  -p [_p_a_t_t_e_r_n]  --pattern=[_p_a_t_t_e_r_n]
163bd4fcc09Stron                  Start at pattern (from command line).
164bd4fcc09Stron  -P [_p_r_o_m_p_t]   --prompt=[_p_r_o_m_p_t]
165bd4fcc09Stron                  Define new prompt.
166bd4fcc09Stron  -q  -Q  ....  --quiet  --QUIET  --silent --SILENT
167bd4fcc09Stron                  Quiet the terminal bell.
168bd4fcc09Stron  -r  -R  ....  --raw-control-chars  --RAW-CONTROL-CHARS
169bd4fcc09Stron                  Output "raw" control characters.
170bd4fcc09Stron  -s  ........  --squeeze-blank-lines
171bd4fcc09Stron                  Squeeze multiple blank lines.
172bd4fcc09Stron  -S  ........  --chop-long-lines
173*0a7fbd90Stron                  Chop (truncate) long lines rather than wrapping.
174bd4fcc09Stron  -t [_t_a_g]  ..  --tag=[_t_a_g]
175bd4fcc09Stron                  Find a tag.
176bd4fcc09Stron  -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e]
177bd4fcc09Stron                  Use an alternate tags file.
178bd4fcc09Stron  -u  -U  ....  --underline-special  --UNDERLINE-SPECIAL
179bd4fcc09Stron                  Change handling of backspaces.
180bd4fcc09Stron  -V  ........  --version
181bd4fcc09Stron                  Display the version number of "less".
182bd4fcc09Stron  -w  ........  --hilite-unread
183bd4fcc09Stron                  Highlight first new line after forward-screen.
184bd4fcc09Stron  -W  ........  --HILITE-UNREAD
185bd4fcc09Stron                  Highlight first new line after any forward movement.
186bd4fcc09Stron  -x [_N[,...]]  --tabs=[_N[,...]]
187bd4fcc09Stron                  Set tab stops.
188bd4fcc09Stron  -X  ........  --no-init
189bd4fcc09Stron                  Don't use termcap init/deinit strings.
190bd4fcc09Stron  -y [_N]  ....  --max-forw-scroll=[_N]
191bd4fcc09Stron                  Forward scroll limit.
192bd4fcc09Stron  -z [_N]  ....  --window=[_N]
193bd4fcc09Stron                  Set size of window.
194bd4fcc09Stron  -" [_c[_c]]  .  --quotes=[_c[_c]]
195bd4fcc09Stron                  Set shell quote characters.
196bd4fcc09Stron  -~  ........  --tilde
197bd4fcc09Stron                  Don't display tildes after end of file.
198bd4fcc09Stron  -# [_N]  ....  --shift=[_N]
199bd4fcc09Stron                  Horizontal scroll amount (0 = one half screen width)
200bd4fcc09Stron      ........  --no-keypad
201*0a7fbd90Stron                  Don't send termcap keypad init/deinit strings.
202bd4fcc09Stron      ........  --follow-name
203bd4fcc09Stron                  The F command changes files if the input file is renamed.
204bd4fcc09Stron
205bd4fcc09Stron
206bd4fcc09Stron ---------------------------------------------------------------------------
207bd4fcc09Stron
208bd4fcc09Stron                          LLIINNEE EEDDIITTIINNGG
209bd4fcc09Stron
210bd4fcc09Stron        These keys can be used to edit text being entered
211bd4fcc09Stron        on the "command line" at the bottom of the screen.
212bd4fcc09Stron
213bd4fcc09Stron RightArrow                       ESC-l     Move cursor right one character.
214bd4fcc09Stron LeftArrow                        ESC-h     Move cursor left one character.
215*0a7fbd90Stron ctrl-RightArrow  ESC-RightArrow  ESC-w     Move cursor right one word.
216*0a7fbd90Stron ctrl-LeftArrow   ESC-LeftArrow   ESC-b     Move cursor left one word.
217bd4fcc09Stron HOME                             ESC-0     Move cursor to start of line.
218bd4fcc09Stron END                              ESC-$     Move cursor to end of line.
219bd4fcc09Stron BACKSPACE                                  Delete char to left of cursor.
220bd4fcc09Stron DELETE                           ESC-x     Delete char under cursor.
221*0a7fbd90Stron ctrl-BACKSPACE   ESC-BACKSPACE             Delete word to left of cursor.
222*0a7fbd90Stron ctrl-DELETE      ESC-DELETE      ESC-X     Delete word under cursor.
223*0a7fbd90Stron ctrl-U           ESC (MS-DOS only)         Delete entire line.
224bd4fcc09Stron UpArrow                          ESC-k     Retrieve previous command line.
225bd4fcc09Stron DownArrow                        ESC-j     Retrieve next command line.
226bd4fcc09Stron TAB                                        Complete filename & cycle.
227bd4fcc09Stron SHIFT-TAB                        ESC-TAB   Complete filename & reverse cycle.
228*0a7fbd90Stron ctrl-L                                     Complete filename, list all.
229bd4fcc09Stron
230bd4fcc09Stron
231