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