[BACK]Return to lesskey.nro CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Annotation of src/usr.bin/less/lesskey.nro, Revision 1.1.1.1

1.1       etheisen    1: .TH LESSKEY 1
                      2: .SH NAME
                      3: lesskey \- specify key bindings for less
                      4: .SH SYNOPSIS
                      5: .B "lesskey [-o output] [input]"
                      6: .br
                      7: .B "lesskey -V"
                      8: .SH DESCRIPTION
                      9: .I Lesskey
                     10: is used to specify a set of key bindings to be used by
                     11: .I less.
                     12: The input file is a text file which describes the key bindings,
                     13: If the input file is "-", standard input is read.
                     14: If no input file is specified, $HOME/.lesskey is read.
                     15: The output file is a binary file which is used by
                     16: .I less.
                     17: If no output file is specified, $HOME/.less is written.
                     18: If the output file already exists,
                     19: .I lesskey
                     20: will overwrite it.
                     21: .PP
                     22: The input file consists of lines of the form:
                     23: .sp
                     24:        \fIstring\fP <whitespace> \fIaction\fP [extra-string] <newline>
                     25: .sp
                     26: Whitespace is any sequence of one or more spaces and/or tabs.
                     27: The \fIstring\fP is the command key(s) which invoke the action.
                     28: The \fIstring\fP may be a single command key, or a sequence of up to 15 keys.
                     29: The \fIaction\fP is the name of the less action, from the list below.
                     30: The characters in the \fIstring\fP may appear literally, or be
                     31: prefixed by a caret to indicate a control key.
                     32: A backslash followed by one to three octal digits may be used to
                     33: specify a character by its octal value.
                     34: A backslash followed by b, e, n, r or t specifies
                     35: BACKSPACE, ESCAPE, NEWLINE, RETURN or TAB, respectively.
                     36: A backslash followed by any other character indicates that character is
                     37: to be taken literally.
                     38: Characters which must be preceded by backslash include
                     39: caret, space, tab and the backslash itself.
                     40: Blank lines and lines which start with a pound sign (#) are ignored.
                     41: .PP
                     42: An action may be followed by an "extra" string.
                     43: When such a command is entered while running
                     44: .I less,
                     45: the action is performed, and then the extra
                     46: string is parsed, just as if it were typed in to
                     47: .I less.
                     48: This feature can be used in certain cases to extend
                     49: the functionality of a command.
                     50: For example, see the "{" and ":t" commands in the example below.
                     51: .PP
                     52: The -V flag causes
                     53: .I lesskey
                     54: to print its version number and immediately exit.
                     55: Other flags and arguments are ignored.
                     56:
                     57: .SH EXAMPLE
                     58: The following input file describes the set of
                     59: default command keys used by less:
                     60: .sp
                     61: .nf
                     62:        \er             forw-line
                     63:        \en             forw-line
                     64:        e               forw-line
                     65:        j               forw-line
                     66:        ^E              forw-line
                     67:        ^N              forw-line
                     68:        k               back-line
                     69:        y               back-line
                     70:        ^Y              back-line
                     71:        ^K              back-line
                     72:        ^P              back-line
                     73:        J               forw-line-force
                     74:        K               back-line-force
                     75:        Y               back-line-force
                     76:        d               forw-scroll
                     77:        ^D              forw-scroll
                     78:        u               back-scroll
                     79:        ^U              back-scroll
                     80:        \e40            forw-screen
                     81:        f               forw-screen
                     82:        ^F              forw-screen
                     83:        ^V              forw-screen
                     84:        b               back-screen
                     85:        ^B              back-screen
                     86:        \eev            back-screen
                     87:        z               forw-window
                     88:        w               back-window
                     89:        F               forw-forever
                     90:        R               repaint-flush
                     91:        r               repaint
                     92:        ^R              repaint
                     93:        ^L              repaint
                     94:        g               goto-line
                     95:        <               goto-line
                     96:        \ee<            goto-line
                     97:        p               percent
                     98:        %               percent
                     99:        {               forw-bracket {}
                    100:        }               back-bracket {}
                    101:        (               forw-bracket ()
                    102:        )               back-bracket ()
                    103:        [               forw-bracket []
                    104:        ]               back-bracket []
                    105:        \ee^F           forw-bracket
                    106:        \ee^B           back-bracket
                    107:        G               goto-end
                    108:        \ee>            goto-end
                    109:        >               goto-end
                    110:        =               status
                    111:        ^G              status
                    112:        :f              status
                    113:        /               forw-search
                    114:        ?               back-search
                    115:        \ee/            forw-search *
                    116:        \ee?            back-search *
                    117:        n               repeat-search
                    118:        \een            repeat-search-all
                    119:        N               reverse-search
                    120:        \eeN            reverse-search-all
                    121:        \eu             undo-hilite
                    122:        m               set-mark
                    123:        '               goto-mark
                    124:        ^X^X            goto-mark
                    125:        E               examine
                    126:        :e              examine
                    127:        ^X^V            examine
                    128:        :n              next-file
                    129:        :p              prev-file
                    130:        :x              index-file
                    131:        -               toggle-option
                    132:        :t              toggle-option t
                    133:        s               toggle-option o
                    134:        _               display-option
                    135:        |               pipe
                    136:        v               visual
                    137:        !               shell
                    138:        +               firstcmd
                    139:        H               help
                    140:        h               help
                    141:        V               version
                    142:        q               quit
                    143:        :q              quit
                    144:        :Q              quit
                    145:        ZZ              quit
                    146: .fi
                    147: .sp
                    148: .SH PRECEDENCE
                    149: Commands specified by
                    150: .I lesskey
                    151: take precedence over the default commands.
                    152: A default command key may be disabled by including it in the
                    153: input file with the action "invalid".
                    154: Alternatively, a key may be defined
                    155: to do nothing by using the action "noaction".
                    156: "noaction" is similar to "invalid", but
                    157: .I less
                    158: will give an error beep for an "invalid" command,
                    159: but not for a "noaction" command.
                    160: In addition, ALL default commands may be disabled by
                    161: adding this control line to the input file:
                    162: .sp
                    163: #stop
                    164: .sp
                    165: This will cause all default commands to be ignored.
                    166: The #stop line should be the last line in that section of the file.
                    167: (Another section, introduced by #line-edit, may follow the #stop line.)
                    168: .PP
                    169: Be aware that #stop can be dangerous.
                    170: Since all default commands are disabled,
                    171: you must provide sufficient commands before the #stop line
                    172: to enable all necessary actions.
                    173: For example, failure to provide a "quit" command can lead to frustration.
                    174:
                    175: .SH "LINE EDITING"
                    176: New key bindings may be specified for the line editing commands,
                    177: in a manner similar to the way key bindings for
                    178: ordinary commands are specified.
                    179: This control line marks the beginning of a section of line-editing commands:
                    180: .sp
                    181: #line-edit
                    182: .sp
                    183: Following this line is a list of keys and actions,
                    184: one per line as in the example below.
                    185:
                    186: .SH EXAMPLE
                    187: The following input file describes the set of
                    188: default line-editing keys used by less:
                    189: .sp
                    190: .nf
                    191:        #line-edit
                    192:        \et             forw-complete
                    193:        \e17            back-complete
                    194:        \ee\et          back-complete
                    195:        \e14            expand
                    196:        ^V              literal
                    197:        ^A              literal
                    198:        \eel            right
                    199:        \eeh            left
                    200:        \eeb            word-left
                    201:        \eew            word-right
                    202:        \eei            insert
                    203:        \eex            delete
                    204:        \ee\eb          word-backspace
                    205:        \ee0            home
                    206:        \ee$            end
                    207:        \eek            up
                    208:        \eej            down
                    209: .fi
                    210: .sp
                    211:
                    212: .SH "SEE ALSO"
                    213: less(1)
                    214:
                    215: .SH COPYRIGHT
                    216: Copyright (c) 1984,1985,1989,1994,1995  Mark Nudelman