xref: /netbsd-src/external/bsd/less/dist/less.hlp (revision e4a6e799a67c2028562d75b4e61407b22434aa36)
120006a0bStron
220006a0bStron                   SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
320006a0bStron
420006a0bStron      Commands marked with * may be preceded by a number, _N.
520006a0bStron      Notes in parentheses indicate the behavior if _N is given.
6749ad2faStron      A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
720006a0bStron
820006a0bStron  h  H                 Display this help.
920006a0bStron  q  :q  Q  :Q  ZZ     Exit.
1020006a0bStron ---------------------------------------------------------------------------
1120006a0bStron
1220006a0bStron                           MMOOVVIINNGG
1320006a0bStron
1420006a0bStron  e  ^E  j  ^N  CR  *  Forward  one line   (or _N lines).
1520006a0bStron  y  ^Y  k  ^K  ^P  *  Backward one line   (or _N lines).
1620006a0bStron  f  ^F  ^V  SPACE  *  Forward  one window (or _N lines).
1720006a0bStron  b  ^B  ESC-v      *  Backward one window (or _N lines).
1820006a0bStron  z                 *  Forward  one window (and set window to _N).
1920006a0bStron  w                 *  Backward one window (and set window to _N).
2020006a0bStron  ESC-SPACE         *  Forward  one window, but don't stop at end-of-file.
2120006a0bStron  d  ^D             *  Forward  one half-window (and set half-window to _N).
2220006a0bStron  u  ^U             *  Backward one half-window (and set half-window to _N).
23*e4a6e799Ssimonb  ESC-)  RightArrow *  Right one half screen width (or _N positions).
24*e4a6e799Ssimonb  ESC-(  LeftArrow  *  Left  one half screen width (or _N positions).
25*e4a6e799Ssimonb  ESC-}  ^RightArrow   Right to last column displayed.
26*e4a6e799Ssimonb  ESC-{  ^LeftArrow    Left  to first column.
2720006a0bStron  F                    Forward forever; like "tail -f".
28*e4a6e799Ssimonb  ESC-F                Like F but stop when search pattern is found.
2920006a0bStron  r  ^R  ^L            Repaint screen.
3020006a0bStron  R                    Repaint screen, discarding buffered input.
3120006a0bStron        ---------------------------------------------------
3220006a0bStron        Default "window" is the screen height.
3320006a0bStron        Default "half-window" is half of the screen height.
3420006a0bStron ---------------------------------------------------------------------------
3520006a0bStron
3620006a0bStron                          SSEEAARRCCHHIINNGG
3720006a0bStron
3820006a0bStron  /_p_a_t_t_e_r_n          *  Search forward for (_N-th) matching line.
3920006a0bStron  ?_p_a_t_t_e_r_n          *  Search backward for (_N-th) matching line.
4020006a0bStron  n                 *  Repeat previous search (for _N-th occurrence).
4120006a0bStron  N                 *  Repeat previous search in reverse direction.
4220006a0bStron  ESC-n             *  Repeat previous search, spanning files.
4320006a0bStron  ESC-N             *  Repeat previous search, reverse dir. & spanning files.
4420006a0bStron  ESC-u                Undo (toggle) search highlighting.
45*e4a6e799Ssimonb  ESC-U                Clear search highlighting.
46*e4a6e799Ssimonb  &_p_a_t_t_e_r_n          *  Display only matching lines.
4720006a0bStron        ---------------------------------------------------
48*e4a6e799Ssimonb        A search pattern may begin with one or more of:
4920006a0bStron        ^N or !  Search for NON-matching lines.
5020006a0bStron        ^E or *  Search multiple files (pass thru END OF FILE).
5120006a0bStron        ^F or @  Start search at FIRST file (for /) or last file (for ?).
5220006a0bStron        ^K       Highlight matches, but don't move (KEEP position).
5320006a0bStron        ^R       Don't use REGULAR EXPRESSIONS.
54*e4a6e799Ssimonb        ^S _n     Search for match in _n-th parenthesized subpattern.
55*e4a6e799Ssimonb        ^W       WRAP search if no match found.
5620006a0bStron ---------------------------------------------------------------------------
5720006a0bStron
5820006a0bStron                           JJUUMMPPIINNGG
5920006a0bStron
6020006a0bStron  g  <  ESC-<       *  Go to first line in file (or line _N).
6120006a0bStron  G  >  ESC->       *  Go to last line in file (or line _N).
6220006a0bStron  p  %              *  Go to beginning of file (or _N percent into file).
6320006a0bStron  t                 *  Go to the (_N-th) next tag.
6420006a0bStron  T                 *  Go to the (_N-th) previous tag.
6520006a0bStron  {  (  [           *  Find close bracket } ) ].
6620006a0bStron  }  )  ]           *  Find open bracket { ( [.
6720006a0bStron  ESC-^F _<_c_1_> _<_c_2_>  *  Find close bracket _<_c_2_>.
68*e4a6e799Ssimonb  ESC-^B _<_c_1_> _<_c_2_>  *  Find open bracket _<_c_1_>.
6920006a0bStron        ---------------------------------------------------
7020006a0bStron        Each "find close bracket" command goes forward to the close bracket
7120006a0bStron          matching the (_N-th) open bracket in the top line.
7220006a0bStron        Each "find open bracket" command goes backward to the open bracket
7320006a0bStron          matching the (_N-th) close bracket in the bottom line.
7420006a0bStron
75*e4a6e799Ssimonb  m_<_l_e_t_t_e_r_>            Mark the current top line with <letter>.
76*e4a6e799Ssimonb  M_<_l_e_t_t_e_r_>            Mark the current bottom line with <letter>.
7720006a0bStron  '_<_l_e_t_t_e_r_>            Go to a previously marked position.
7820006a0bStron  ''                   Go to the previous position.
7920006a0bStron  ^X^X                 Same as '.
80*e4a6e799Ssimonb  ESC-m_<_l_e_t_t_e_r_>        Clear a mark.
8120006a0bStron        ---------------------------------------------------
8220006a0bStron        A mark is any upper-case or lower-case letter.
8320006a0bStron        Certain marks are predefined:
8420006a0bStron             ^  means  beginning of the file
8520006a0bStron             $  means  end of the file
8620006a0bStron ---------------------------------------------------------------------------
8720006a0bStron
8820006a0bStron                        CCHHAANNGGIINNGG FFIILLEESS
8920006a0bStron
9020006a0bStron  :e [_f_i_l_e]            Examine a new file.
9120006a0bStron  ^X^V                 Same as :e.
9220006a0bStron  :n                *  Examine the (_N-th) next file from the command line.
9320006a0bStron  :p                *  Examine the (_N-th) previous file from the command line.
9420006a0bStron  :x                *  Examine the first (or _N-th) file from the command line.
9520006a0bStron  :d                   Delete the current file from the command line list.
9620006a0bStron  =  ^G  :f            Print current file name.
9720006a0bStron ---------------------------------------------------------------------------
9820006a0bStron
9920006a0bStron                    MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS
10020006a0bStron
10120006a0bStron  -_<_f_l_a_g_>              Toggle a command line option [see OPTIONS below].
10220006a0bStron  --_<_n_a_m_e_>             Toggle a command line option, by name.
10320006a0bStron  __<_f_l_a_g_>              Display the setting of a command line option.
10420006a0bStron  ___<_n_a_m_e_>             Display the setting of an option, by name.
10520006a0bStron  +_c_m_d                 Execute the less cmd each time a new file is examined.
10620006a0bStron
10720006a0bStron  !_c_o_m_m_a_n_d             Execute the shell command with $SHELL.
108*e4a6e799Ssimonb  #_c_o_m_m_a_n_d             Execute the shell command, expanded like a prompt.
10920006a0bStron  |XX_c_o_m_m_a_n_d            Pipe file between current pos & mark XX to shell command.
110*e4a6e799Ssimonb  s _f_i_l_e               Save input to a file.
11120006a0bStron  v                    Edit the current file with $VISUAL or $EDITOR.
11220006a0bStron  V                    Print version number of "less".
11320006a0bStron ---------------------------------------------------------------------------
11420006a0bStron
11520006a0bStron                           OOPPTTIIOONNSS
11620006a0bStron
11720006a0bStron        Most options may be changed either on the command line,
11820006a0bStron        or from within less by using the - or -- command.
11920006a0bStron        Options may be given in one of two forms: either a single
120749ad2faStron        character preceded by a -, or a name preceded by --.
12120006a0bStron
12220006a0bStron  -?  ........  --help
12320006a0bStron                  Display help (from command line).
12420006a0bStron  -a  ........  --search-skip-screen
125749ad2faStron                  Search skips current screen.
12620006a0bStron  -A  ........  --SEARCH-SKIP-SCREEN
127749ad2faStron                  Search starts just after target line.
12820006a0bStron  -b [_N]  ....  --buffers=[_N]
12920006a0bStron                  Number of buffers.
13020006a0bStron  -B  ........  --auto-buffers
13120006a0bStron                  Don't automatically allocate buffers for pipes.
13220006a0bStron  -c  ........  --clear-screen
13320006a0bStron                  Repaint by clearing rather than scrolling.
13420006a0bStron  -d  ........  --dumb
13520006a0bStron                  Dumb terminal.
136*e4a6e799Ssimonb  -D xx_c_o_l_o_r  .  --color=xx_c_o_l_o_r
137*e4a6e799Ssimonb                  Set screen colors.
13820006a0bStron  -e  -E  ....  --quit-at-eof  --QUIT-AT-EOF
13920006a0bStron                  Quit at end of file.
14020006a0bStron  -f  ........  --force
14120006a0bStron                  Force open non-regular files.
14220006a0bStron  -F  ........  --quit-if-one-screen
14320006a0bStron                  Quit if entire file fits on first screen.
14420006a0bStron  -g  ........  --hilite-search
14520006a0bStron                  Highlight only last match for searches.
14620006a0bStron  -G  ........  --HILITE-SEARCH
14720006a0bStron                  Don't highlight any matches for searches.
14820006a0bStron  -h [_N]  ....  --max-back-scroll=[_N]
14920006a0bStron                  Backward scroll limit.
15020006a0bStron  -i  ........  --ignore-case
15120006a0bStron                  Ignore case in searches that do not contain uppercase.
15220006a0bStron  -I  ........  --IGNORE-CASE
15320006a0bStron                  Ignore case in all searches.
15420006a0bStron  -j [_N]  ....  --jump-target=[_N]
15520006a0bStron                  Screen position of target lines.
15620006a0bStron  -J  ........  --status-column
15720006a0bStron                  Display a status column at left edge of screen.
15820006a0bStron  -k [_f_i_l_e]  .  --lesskey-file=[_f_i_l_e]
15920006a0bStron                  Use a lesskey file.
160*e4a6e799Ssimonb  -K  ........  --quit-on-intr
16120006a0bStron                  Exit less in response to ctrl-C.
16220006a0bStron  -L  ........  --no-lessopen
16320006a0bStron                  Ignore the LESSOPEN environment variable.
16420006a0bStron  -m  -M  ....  --long-prompt  --LONG-PROMPT
16520006a0bStron                  Set prompt style.
166*e4a6e799Ssimonb  -n .........  --line-numbers
167*e4a6e799Ssimonb                  Suppress line numbers in prompts and messages.
168*e4a6e799Ssimonb  -N .........  --LINE-NUMBERS
169*e4a6e799Ssimonb                  Display line number at start of each line.
17020006a0bStron  -o [_f_i_l_e]  .  --log-file=[_f_i_l_e]
17120006a0bStron                  Copy to log file (standard input only).
17220006a0bStron  -O [_f_i_l_e]  .  --LOG-FILE=[_f_i_l_e]
17320006a0bStron                  Copy to log file (unconditionally overwrite).
17420006a0bStron  -p [_p_a_t_t_e_r_n]  --pattern=[_p_a_t_t_e_r_n]
17520006a0bStron                  Start at pattern (from command line).
17620006a0bStron  -P [_p_r_o_m_p_t]   --prompt=[_p_r_o_m_p_t]
17720006a0bStron                  Define new prompt.
17820006a0bStron  -q  -Q  ....  --quiet  --QUIET  --silent --SILENT
17920006a0bStron                  Quiet the terminal bell.
18020006a0bStron  -r  -R  ....  --raw-control-chars  --RAW-CONTROL-CHARS
18120006a0bStron                  Output "raw" control characters.
18220006a0bStron  -s  ........  --squeeze-blank-lines
18320006a0bStron                  Squeeze multiple blank lines.
18420006a0bStron  -S  ........  --chop-long-lines
185749ad2faStron                  Chop (truncate) long lines rather than wrapping.
18620006a0bStron  -t [_t_a_g]  ..  --tag=[_t_a_g]
18720006a0bStron                  Find a tag.
18820006a0bStron  -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e]
18920006a0bStron                  Use an alternate tags file.
19020006a0bStron  -u  -U  ....  --underline-special  --UNDERLINE-SPECIAL
191*e4a6e799Ssimonb                  Change handling of backspaces, tabs and carriage returns.
19220006a0bStron  -V  ........  --version
19320006a0bStron                  Display the version number of "less".
19420006a0bStron  -w  ........  --hilite-unread
19520006a0bStron                  Highlight first new line after forward-screen.
19620006a0bStron  -W  ........  --HILITE-UNREAD
19720006a0bStron                  Highlight first new line after any forward movement.
19820006a0bStron  -x [_N[,...]]  --tabs=[_N[,...]]
19920006a0bStron                  Set tab stops.
20020006a0bStron  -X  ........  --no-init
20120006a0bStron                  Don't use termcap init/deinit strings.
20220006a0bStron  -y [_N]  ....  --max-forw-scroll=[_N]
20320006a0bStron                  Forward scroll limit.
20420006a0bStron  -z [_N]  ....  --window=[_N]
20520006a0bStron                  Set size of window.
20620006a0bStron  -" [_c[_c]]  .  --quotes=[_c[_c]]
20720006a0bStron                  Set shell quote characters.
20820006a0bStron  -~  ........  --tilde
20920006a0bStron                  Don't display tildes after end of file.
21020006a0bStron  -# [_N]  ....  --shift=[_N]
211*e4a6e799Ssimonb                  Set horizontal scroll amount (0 = one half screen width).
212*e4a6e799Ssimonb                --exit-follow-on-close
213*e4a6e799Ssimonb                  Exit F command on a pipe when writer closes pipe.
214*e4a6e799Ssimonb                --file-size
215*e4a6e799Ssimonb                  Automatically determine the size of the input file.
216*e4a6e799Ssimonb                --follow-name
21720006a0bStron                  The F command changes files if the input file is renamed.
218*e4a6e799Ssimonb                --header=[_N[,_M]]
219*e4a6e799Ssimonb                  Use N lines and M columns to display file headers.
220*e4a6e799Ssimonb                --incsearch
221*e4a6e799Ssimonb                  Search file as each pattern character is typed in.
222*e4a6e799Ssimonb                --intr=_C
223*e4a6e799Ssimonb                  Use _C instead of ^X to interrupt a read.
224*e4a6e799Ssimonb                --line-num-width=_N
225*e4a6e799Ssimonb                  Set the width of the -N line number field to _N characters.
226*e4a6e799Ssimonb                --modelines=_N
227*e4a6e799Ssimonb                  Read _N lines from the input file and look for vim modelines.
228*e4a6e799Ssimonb                --mouse
229*e4a6e799Ssimonb                  Enable mouse input.
230*e4a6e799Ssimonb                --no-keypad
231*e4a6e799Ssimonb                  Don't send termcap keypad init/deinit strings.
232*e4a6e799Ssimonb                --no-histdups
233*e4a6e799Ssimonb                  Remove duplicates from command history.
234*e4a6e799Ssimonb                --no-number-headers
235*e4a6e799Ssimonb                  Don't give line numbers to header lines.
236*e4a6e799Ssimonb                --no-search-headers
237*e4a6e799Ssimonb                  Don't search in header lines or columns.
238*e4a6e799Ssimonb                --no-vbell
239*e4a6e799Ssimonb                  Disable the terminal's visual bell.
240*e4a6e799Ssimonb                --redraw-on-quit
241*e4a6e799Ssimonb                  Redraw final screen when quitting.
242*e4a6e799Ssimonb                --rscroll=_C
243*e4a6e799Ssimonb                  Set the character used to mark truncated lines.
244*e4a6e799Ssimonb                --save-marks
245*e4a6e799Ssimonb                  Retain marks across invocations of less.
246*e4a6e799Ssimonb                --search-options=[EFKNRW-]
247*e4a6e799Ssimonb                  Set default options for every search.
248*e4a6e799Ssimonb                --show-preproc-errors
249*e4a6e799Ssimonb                  Display a message if preprocessor exits with an error status.
250*e4a6e799Ssimonb                --proc-backspace
251*e4a6e799Ssimonb                  Process backspaces for bold/underline.
252*e4a6e799Ssimonb                --SPECIAL-BACKSPACE
253*e4a6e799Ssimonb                  Treat backspaces as control characters.
254*e4a6e799Ssimonb                --proc-return
255*e4a6e799Ssimonb                  Delete carriage returns before newline.
256*e4a6e799Ssimonb                --SPECIAL-RETURN
257*e4a6e799Ssimonb                  Treat carriage returns as control characters.
258*e4a6e799Ssimonb                --proc-tab
259*e4a6e799Ssimonb                  Expand tabs to spaces.
260*e4a6e799Ssimonb                --SPECIAL-TAB
261*e4a6e799Ssimonb                  Treat tabs as control characters.
262*e4a6e799Ssimonb                --status-col-width=_N
263*e4a6e799Ssimonb                  Set the width of the -J status column to _N characters.
264*e4a6e799Ssimonb                --status-line
265*e4a6e799Ssimonb                  Highlight or color the entire line containing a mark.
266*e4a6e799Ssimonb                --use-backslash
267*e4a6e799Ssimonb                  Subsequent options use backslash as escape char.
268*e4a6e799Ssimonb                --use-color
269*e4a6e799Ssimonb                  Enables colored text.
270*e4a6e799Ssimonb                --wheel-lines=_N
271*e4a6e799Ssimonb                  Each click of the mouse wheel moves _N lines.
272*e4a6e799Ssimonb                --wordwrap
273*e4a6e799Ssimonb                  Wrap lines at spaces.
27420006a0bStron
27520006a0bStron
27620006a0bStron ---------------------------------------------------------------------------
27720006a0bStron
27820006a0bStron                          LLIINNEE EEDDIITTIINNGG
27920006a0bStron
28020006a0bStron        These keys can be used to edit text being entered
28120006a0bStron        on the "command line" at the bottom of the screen.
28220006a0bStron
283*e4a6e799Ssimonb RightArrow ..................... ESC-l ... Move cursor right one character.
284*e4a6e799Ssimonb LeftArrow ...................... ESC-h ... Move cursor left one character.
285*e4a6e799Ssimonb ctrl-RightArrow  ESC-RightArrow  ESC-w ... Move cursor right one word.
286*e4a6e799Ssimonb ctrl-LeftArrow   ESC-LeftArrow   ESC-b ... Move cursor left one word.
287*e4a6e799Ssimonb HOME ........................... ESC-0 ... Move cursor to start of line.
288*e4a6e799Ssimonb END ............................ ESC-$ ... Move cursor to end of line.
289*e4a6e799Ssimonb BACKSPACE ................................ Delete char to left of cursor.
290*e4a6e799Ssimonb DELETE ......................... ESC-x ... Delete char under cursor.
291*e4a6e799Ssimonb ctrl-BACKSPACE   ESC-BACKSPACE ........... Delete word to left of cursor.
292*e4a6e799Ssimonb ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor.
293*e4a6e799Ssimonb ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line.
294*e4a6e799Ssimonb UpArrow ........................ ESC-k ... Retrieve previous command line.
295*e4a6e799Ssimonb DownArrow ...................... ESC-j ... Retrieve next command line.
296*e4a6e799Ssimonb TAB ...................................... Complete filename & cycle.
297*e4a6e799Ssimonb SHIFT-TAB ...................... ESC-TAB   Complete filename & reverse cycle.
298*e4a6e799Ssimonb ctrl-L ................................... Complete filename, list all.
299