less.hlp revision 238730
178527Sassar
255682Smarkm                   SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
378527Sassar
478527Sassar      Commands marked with * may be preceded by a number, _N.
555682Smarkm      Notes in parentheses indicate the behavior if _N is given.
655682Smarkm      A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
755682Smarkm
855682Smarkm  h  H                 Display this help.
955682Smarkm  q  :q  Q  :Q  ZZ     Exit.
1055682Smarkm ---------------------------------------------------------------------------
1155682Smarkm
1255682Smarkm                           MMOOVVIINNGG
1355682Smarkm
1455682Smarkm  e  ^E  j  ^N  CR  *  Forward  one line   (or _N lines).
1555682Smarkm  y  ^Y  k  ^K  ^P  *  Backward one line   (or _N lines).
1655682Smarkm  f  ^F  ^V  SPACE  *  Forward  one window (or _N lines).
1755682Smarkm  b  ^B  ESC-v      *  Backward one window (or _N lines).
1855682Smarkm  z                 *  Forward  one window (and set window to _N).
1955682Smarkm  w                 *  Backward one window (and set window to _N).
2055682Smarkm  ESC-SPACE         *  Forward  one window, but don't stop at end-of-file.
2155682Smarkm  d  ^D             *  Forward  one half-window (and set half-window to _N).
2255682Smarkm  u  ^U             *  Backward one half-window (and set half-window to _N).
2355682Smarkm  ESC-)  RightArrow *  Left  one half screen width (or _N positions).
2455682Smarkm  ESC-(  LeftArrow  *  Right one half screen width (or _N positions).
2555682Smarkm  F                    Forward forever; like "tail -f".
2655682Smarkm  r  ^R  ^L            Repaint screen.
2755682Smarkm  R                    Repaint screen, discarding buffered input.
2855682Smarkm        ---------------------------------------------------
2955682Smarkm        Default "window" is the screen height.
3055682Smarkm        Default "half-window" is half of the screen height.
3155682Smarkm ---------------------------------------------------------------------------
3255682Smarkm
3355682Smarkm                          SSEEAARRCCHHIINNGG
3455682Smarkm
3555682Smarkm  /_p_a_t_t_e_r_n          *  Search forward for (_N-th) matching line.
3655682Smarkm  ?_p_a_t_t_e_r_n          *  Search backward for (_N-th) matching line.
3755682Smarkm  n                 *  Repeat previous search (for _N-th occurrence).
3855682Smarkm  N                 *  Repeat previous search in reverse direction.
3955682Smarkm  ESC-n             *  Repeat previous search, spanning files.
4072445Sassar  ESC-N             *  Repeat previous search, reverse dir. & spanning files.
4172445Sassar  ESC-u                Undo (toggle) search highlighting.
4255682Smarkm  &_p_a_t_t_e_r_n          *  Display only matching lines
4355682Smarkm        ---------------------------------------------------
4455682Smarkm        A search pattern may be preceded by one or more of:
4555682Smarkm        ^N or !  Search for NON-matching lines.
4655682Smarkm        ^E or *  Search multiple files (pass thru END OF FILE).
4772445Sassar        ^F or @  Start search at FIRST file (for /) or last file (for ?).
4855682Smarkm        ^K       Highlight matches, but don't move (KEEP position).
4955682Smarkm        ^R       Don't use REGULAR EXPRESSIONS.
5072445Sassar ---------------------------------------------------------------------------
5155682Smarkm
5255682Smarkm                           JJUUMMPPIINNGG
5355682Smarkm
5455682Smarkm  g  <  ESC-<       *  Go to first line in file (or line _N).
5555682Smarkm  G  >  ESC->       *  Go to last line in file (or line _N).
5655682Smarkm  p  %              *  Go to beginning of file (or _N percent into file).
5755682Smarkm  t                 *  Go to the (_N-th) next tag.
5855682Smarkm  T                 *  Go to the (_N-th) previous tag.
5972445Sassar  {  (  [           *  Find close bracket } ) ].
6072445Sassar  }  )  ]           *  Find open bracket { ( [.
6155682Smarkm  ESC-^F _<_c_1_> _<_c_2_>  *  Find close bracket _<_c_2_>.
6255682Smarkm  ESC-^B _<_c_1_> _<_c_2_>  *  Find open bracket _<_c_1_> 
6355682Smarkm        ---------------------------------------------------
6472445Sassar        Each "find close bracket" command goes forward to the close bracket 
6572445Sassar          matching the (_N-th) open bracket in the top line.
6672445Sassar        Each "find open bracket" command goes backward to the open bracket 
6755682Smarkm          matching the (_N-th) close bracket in the bottom line.
6855682Smarkm
6955682Smarkm  m_<_l_e_t_t_e_r_>            Mark the current position with <letter>.
7055682Smarkm  '_<_l_e_t_t_e_r_>            Go to a previously marked position.
7155682Smarkm  ''                   Go to the previous position.
7272445Sassar  ^X^X                 Same as '.
7372445Sassar        ---------------------------------------------------
7472445Sassar        A mark is any upper-case or lower-case letter.
7555682Smarkm        Certain marks are predefined:
7672445Sassar             ^  means  beginning of the file
7772445Sassar             $  means  end of the file
7872445Sassar ---------------------------------------------------------------------------
7972445Sassar
8055682Smarkm                        CCHHAANNGGIINNGG FFIILLEESS
8155682Smarkm
8255682Smarkm  :e [_f_i_l_e]            Examine a new file.
8372445Sassar  ^X^V                 Same as :e.
8455682Smarkm  :n                *  Examine the (_N-th) next file from the command line.
8555682Smarkm  :p                *  Examine the (_N-th) previous file from the command line.
8655682Smarkm  :x                *  Examine the first (or _N-th) file from the command line.
8755682Smarkm  :d                   Delete the current file from the command line list.
8855682Smarkm  =  ^G  :f            Print current file name.
8955682Smarkm ---------------------------------------------------------------------------
9072445Sassar
9172445Sassar                    MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS
9255682Smarkm
9355682Smarkm  -_<_f_l_a_g_>              Toggle a command line option [see OPTIONS below].
9455682Smarkm  --_<_n_a_m_e_>             Toggle a command line option, by name.
9555682Smarkm  __<_f_l_a_g_>              Display the setting of a command line option.
9655682Smarkm  ___<_n_a_m_e_>             Display the setting of an option, by name.
9755682Smarkm  +_c_m_d                 Execute the less cmd each time a new file is examined.
9855682Smarkm
9955682Smarkm  !_c_o_m_m_a_n_d             Execute the shell command with $SHELL.
10055682Smarkm  |XX_c_o_m_m_a_n_d            Pipe file between current pos & mark XX to shell command.
10155682Smarkm  v                    Edit the current file with $VISUAL or $EDITOR.
10272445Sassar  V                    Print version number of "less".
10355682Smarkm ---------------------------------------------------------------------------
10455682Smarkm
10555682Smarkm                           OOPPTTIIOONNSS
10672445Sassar
10755682Smarkm        Most options may be changed either on the command line,
10855682Smarkm        or from within less by using the - or -- command.
10955682Smarkm        Options may be given in one of two forms: either a single
11055682Smarkm        character preceded by a -, or a name preceeded by --.
11155682Smarkm
11255682Smarkm  -?  ........  --help
11372445Sassar                  Display help (from command line).
11472445Sassar  -a  ........  --search-skip-screen
11572445Sassar                  Search skips current screen.
11655682Smarkm  -A  ........  --SEARCH-SKIP-SCREEN
11772445Sassar                  Search starts just after target line.
11872445Sassar  -b [_N]  ....  --buffers=[_N]
11972445Sassar                  Number of buffers.
12072445Sassar  -B  ........  --auto-buffers
12172445Sassar                  Don't automatically allocate buffers for pipes.
12272445Sassar  -c  ........  --clear-screen
12378527Sassar                  Repaint by clearing rather than scrolling.
12472445Sassar  -d  ........  --dumb
12572445Sassar                  Dumb terminal.
12655682Smarkm  -D [_x_n_._n]  .  --color=_x_n_._n
12755682Smarkm                  Set screen colors. (MS-DOS only)
12855682Smarkm  -e  -E  ....  --quit-at-eof  --QUIT-AT-EOF
12955682Smarkm                  Quit at end of file.
13072445Sassar  -f  ........  --force
13155682Smarkm                  Force open non-regular files.
13255682Smarkm  -F  ........  --quit-if-one-screen
13355682Smarkm                  Quit if entire file fits on first screen.
13472445Sassar  -g  ........  --hilite-search
13572445Sassar                  Highlight only last match for searches.
13655682Smarkm  -G  ........  --HILITE-SEARCH
13755682Smarkm                  Don't highlight any matches for searches.
13855682Smarkm  -h [_N]  ....  --max-back-scroll=[_N]
13955682Smarkm                  Backward scroll limit.
14055682Smarkm  -i  ........  --ignore-case
14155682Smarkm                  Ignore case in searches that do not contain uppercase.
14255682Smarkm  -I  ........  --IGNORE-CASE
14355682Smarkm                  Ignore case in all searches.
14455682Smarkm  -j [_N]  ....  --jump-target=[_N]
14555682Smarkm                  Screen position of target lines.
14655682Smarkm  -J  ........  --status-column
14755682Smarkm                  Display a status column at left edge of screen.
14855682Smarkm  -k [_f_i_l_e]  .  --lesskey-file=[_f_i_l_e]
14955682Smarkm                  Use a lesskey file.
15055682Smarkm  -K            --quit-on-intr
15155682Smarkm                  Exit less in response to ctrl-C.
15255682Smarkm  -L  ........  --no-lessopen
15355682Smarkm                  Ignore the LESSOPEN environment variable.
15455682Smarkm  -m  -M  ....  --long-prompt  --LONG-PROMPT
15572445Sassar                  Set prompt style.
15655682Smarkm  -n  -N  ....  --line-numbers  --LINE-NUMBERS
15755682Smarkm                  Don't use line numbers.
15855682Smarkm  -o [_f_i_l_e]  .  --log-file=[_f_i_l_e]
15955682Smarkm                  Copy to log file (standard input only).
16055682Smarkm  -O [_f_i_l_e]  .  --LOG-FILE=[_f_i_l_e]
16155682Smarkm                  Copy to log file (unconditionally overwrite).
16255682Smarkm  -p [_p_a_t_t_e_r_n]  --pattern=[_p_a_t_t_e_r_n]
16355682Smarkm                  Start at pattern (from command line).
16472445Sassar  -P [_p_r_o_m_p_t]   --prompt=[_p_r_o_m_p_t]
16572445Sassar                  Define new prompt.
16655682Smarkm  -q  -Q  ....  --quiet  --QUIET  --silent --SILENT
16755682Smarkm                  Quiet the terminal bell.
16855682Smarkm  -r  -R  ....  --raw-control-chars  --RAW-CONTROL-CHARS
16955682Smarkm                  Output "raw" control characters.
17055682Smarkm  -s  ........  --squeeze-blank-lines
17155682Smarkm                  Squeeze multiple blank lines.
17255682Smarkm  -S  ........  --chop-long-lines
17355682Smarkm                  Chop (truncate) long lines rather than wrapping.
17472445Sassar  -t [_t_a_g]  ..  --tag=[_t_a_g]
17572445Sassar                  Find a tag.
17672445Sassar  -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e]
17755682Smarkm                  Use an alternate tags file.
17855682Smarkm  -u  -U  ....  --underline-special  --UNDERLINE-SPECIAL
17955682Smarkm                  Change handling of backspaces.
18055682Smarkm  -V  ........  --version
18155682Smarkm                  Display the version number of "less".
18255682Smarkm  -w  ........  --hilite-unread
18372445Sassar                  Highlight first new line after forward-screen.
18455682Smarkm  -W  ........  --HILITE-UNREAD
18572445Sassar                  Highlight first new line after any forward movement.
18672445Sassar  -x [_N[,...]]  --tabs=[_N[,...]]
18772445Sassar                  Set tab stops.
18855682Smarkm  -X  ........  --no-init
18978527Sassar                  Don't use termcap init/deinit strings.
19078527Sassar  -y [_N]  ....  --max-forw-scroll=[_N]
19155682Smarkm                  Forward scroll limit.
19255682Smarkm  -z [_N]  ....  --window=[_N]
19372445Sassar                  Set size of window.
19455682Smarkm  -" [_c[_c]]  .  --quotes=[_c[_c]]
19572445Sassar                  Set shell quote characters.
19655682Smarkm  -~  ........  --tilde
19755682Smarkm                  Don't display tildes after end of file.
19872445Sassar  -# [_N]  ....  --shift=[_N]
19955682Smarkm                  Horizontal scroll amount (0 = one half screen width)
20055682Smarkm      ........  --no-keypad
20155682Smarkm                  Don't send termcap keypad init/deinit strings.
20255682Smarkm      ........  --follow-name
20355682Smarkm                  The F command changes files if the input file is renamed.
20455682Smarkm
20555682Smarkm
20655682Smarkm ---------------------------------------------------------------------------
20772445Sassar
20872445Sassar                          LLIINNEE EEDDIITTIINNGG
20972445Sassar
21072445Sassar        These keys can be used to edit text being entered 
21172445Sassar        on the "command line" at the bottom of the screen.
21272445Sassar
21355682Smarkm RightArrow                       ESC-l     Move cursor right one character.
21455682Smarkm LeftArrow                        ESC-h     Move cursor left one character.
21572445Sassar ctrl-RightArrow  ESC-RightArrow  ESC-w     Move cursor right one word.
21655682Smarkm ctrl-LeftArrow   ESC-LeftArrow   ESC-b     Move cursor left one word.
21755682Smarkm HOME                             ESC-0     Move cursor to start of line.
21878527Sassar END                              ESC-$     Move cursor to end of line.
21955682Smarkm BACKSPACE                                  Delete char to left of cursor.
22055682Smarkm DELETE                           ESC-x     Delete char under cursor.
22178527Sassar ctrl-BACKSPACE   ESC-BACKSPACE             Delete word to left of cursor.
22255682Smarkm ctrl-DELETE      ESC-DELETE      ESC-X     Delete word under cursor.
22355682Smarkm ctrl-U           ESC (MS-DOS only)         Delete entire line.
22455682Smarkm UpArrow                          ESC-k     Retrieve previous command line.
22555682Smarkm DownArrow                        ESC-j     Retrieve next command line.
22655682Smarkm TAB                                        Complete filename & cycle.
22755682Smarkm SHIFT-TAB                        ESC-TAB   Complete filename & reverse cycle.
22855682Smarkm ctrl-L                                     Complete filename, list all.
22972445Sassar
23072445Sassar
23172445Sassar