Merge from vendor branch TEXINFO:
[dragonfly.git] / lib / libedit / editrc.5
1 .\"     $NetBSD: editrc.5,v 1.4 1997/04/24 20:20:31 christos Exp $
2 .\"
3 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"        This product includes software developed by the NetBSD
19 .\"        Foundation, Inc. and its contributors.
20 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
21 .\"    contributors may be used to endorse or promote products derived
22 .\"    from this software without specific prior written permission.
23 .\"
24 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
25 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
28 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 .\" POSSIBILITY OF SUCH DAMAGE.
35 .\"
36 .\" $FreeBSD: src/lib/libedit/editrc.5,v 1.5.2.4 2001/08/17 15:42:57 ru Exp $
37 .\" $DragonFly: src/lib/libedit/editrc.5,v 1.2 2003/06/17 04:26:49 dillon Exp $
38 .\"
39 .Dd January 11, 1997
40 .Os
41 .Dt EDITRC 5
42 .Sh NAME
43 .Nm editrc
44 .Nd configuration file for editline library
45 .Sh SYNOPSIS
46 .Nm
47 .Sh DESCRIPTION
48 The
49 .Nm
50 file defines various settings to be used by the
51 .Xr editline 3
52 library.
53 .Pp
54 The format of each line is either:
55 .Dl prog:command [arg [...]]
56 or
57 .Dl command [arg [...]]
58 .Pp
59 .Ar command
60 is one of the
61 .Xr editline 3
62 builtin commands.
63 Refer to
64 .Sx BUILTIN COMMANDS
65 for more information.
66 .Pp
67 .Ar prog
68 is the program name string that a program defines when it calls
69 .Xr el_init 3
70 to setup
71 .Xr editline 3 ,
72 which is usually
73 .Va argv[0] .
74 .Ar command
75 will be executed for any program which matches
76 .Ar prog .
77 .Pp
78 .Ar prog
79 may also be a
80 .Xr regex 3
81 style
82 regular expression, in which case
83 .Ar command
84 will be executed for any program that matches the regular expression.
85 .Sh BUILTIN COMMANDS
86 The
87 .Nm editline
88 library has some builtin commands, which affect the way
89 that the line editing and history functions operate.
90 These are based on similar named builtins present in the
91 .Xr tcsh 1
92 shell.
93 .Pp
94 The following builtin commands are available:
95 .Bl -tag -width 4n
96 .It Ic bind Xo
97 .Op Fl a
98 .Op Fl e
99 .Op Fl k
100 .Op Fl l
101 .Op Fl r
102 .Op Fl s
103 .Op Fl v
104 .Op Ar key Op Ar command
105 .Xc
106 Without options, list all bound keys, and the editor command to which
107 each is bound.
108 If
109 .Ar key
110 is supplied, show the bindings for
111 .Ar key .
112 If
113 .Ar key command
114 is supplied, bind
115 .Ar command
116 to
117 .Ar key .
118 Options include:
119 .Bl -tag -width 4n
120 .It Fl e
121 Bind all keys to the standard GNU Emacs-like bindings.
122 .It Fl v
123 Bind all keys to the standard
124 .Xr vi 1 Ns -like
125 bindings.
126 .It Fl a
127 List or change key bindings in the
128 .Xr vi 1
129 mode alternate (command mode) key map.
130 .It Fl k
131 .Ar key
132 is interpreted as a symbolic arrow key name, which may be one of
133 .Sq up ,
134 .Sq down ,
135 .Sq left
136 or
137 .Sq right .
138 .It Fl l
139 List all editor commands and a short description of each.
140 .It Fl r
141 Remove a key's binding.
142 .It Fl s
143 .Ar command
144 is taken as a literal string and treated as terminal input when
145 .Ar key
146 is typed.
147 Bound keys in
148 .Ar command
149 are themselves reinterpreted, and this continues for ten levels of
150 interpretation.
151 .El
152 .Pp
153 .Ar key
154 and
155 .Ar command
156 can contain control characters of the form
157 .Sm off
158 .Sq No ^ Ar character
159 .Sm on
160 (e.g.\&
161 .Sq ^A ) ,
162 and the following backslashed escape sequences:
163 .Pp
164 .Bl -tag -compact -offset indent -width 4n
165 .It Ic \ea
166 Bell
167 .It Ic \eb
168 Backspace
169 .It Ic \ee
170 Escape
171 .It Ic \ef
172 Formfeed
173 .It Ic \en
174 Newline
175 .It Ic \er
176 Carriage return
177 .It Ic \et
178 Horizontal tab
179 .It Ic \ev
180 Vertical tab
181 .Sm off
182 .It Sy \e Ar nnn
183 .Sm on
184 The ASCII character corresponding to the octal number
185 .Ar nnn .
186 .El
187 .Pp
188 .Sq \e
189 nullifies the special meaning of the following character,
190 if it has any, notably
191 .Sq \e
192 and
193 .Sq ^ .
194 .It Ic echotc Xo
195 .Op Fl sv
196 .Ar arg
197 .Ar ...
198 .Xc
199 Exercise terminal capabilities given in
200 .Ar arg Ar ... .
201 If
202 .Ar arg
203 is
204 .Sq baud ,
205 .Sq cols ,
206 .Sq lines ,
207 .Sq rows ,
208 .Sq meta or
209 .Sq tabs ,
210 the value of that capability is printed, with
211 .Dq yes
212 or
213 .Dq no
214 indicating that the terminal does or does not have that capability.
215 .Pp
216 .Fl s
217 returns an empty string for non-existent capabilities, rather than
218 causing an error.
219 .Fl v
220 causes messages to be verbose.
221 .It Ic history
222 List the history.
223 .It Ic telltc
224 List the values of all the terminal capabilities (see
225 .Xr termcap 5 ) .
226 .It Ic settc Ar cap Ar val
227 Set the terminal capability
228 .Ar cap
229 to
230 .Ar val ,
231 as defined in
232 .Xr termcap 5 .
233 No sanity checking is done.
234 .It Ic setty Xo
235 .Op Fl a
236 .Op Fl d
237 .Op Fl q
238 .Op Fl x
239 .Op Ar +mode
240 .Op Ar -mode
241 .Op Ar mode
242 .Xc
243 Control which tty modes that
244 .Nm
245 won't allow the user to change.
246 .Fl d ,
247 .Fl q
248 or
249 .Fl x
250 tells
251 .Ic setty
252 to act on the
253 .Sq edit ,
254 .Sq quote
255 or
256 .Sq execute
257 set of tty modes respectively; defaulting to
258 .Fl x .
259 .Pp
260 Without other arguments,
261 .Ic setty
262 lists the modes in the chosen set which are fixed on
263 .Pq Sq +mode
264 or off
265 .Pq Sq -mode .
266 .Fl a
267 lists all tty modes in the chosen set regardless of the setting.
268 With
269 .Ar +mode ,
270 .Ar -mode
271 or
272 .Ar mode ,
273 fixes
274 .Ar mode
275 on or off or removes control of
276 .Ar mode
277 in the chosen set.
278 .El
279 .Sh SEE ALSO
280 .Xr editline 3 ,
281 .Xr regex 3 ,
282 .Xr termcap 5
283 .Sh AUTHORS
284 .An -nosplit
285 The
286 .Nm editline
287 library was written by
288 .An Christos Zoulas ,
289 and this manual was written by
290 .An Luke Mewburn ,
291 with some sections inspired by
292 .Xr tcsh 1 .