EDITRC(5) BSD Reference Manual EDITRC(5)
editrc - configuration file for editline library
editrc
The editrc file defines various settings to be used by the editline(3) library. It uses similar quoting rules as the shell and ignores leading whitespace, empty lines and hash-led comment lines. The format of each line is: [prog:]command [arg ...] command is one of the editline(3) builtin commands. Refer to BUILTIN COMMANDS for more information. prog is the program name string that a program defines when it calls el_init(3) to set up editline(3), which is usually argv[0] or, probably better, __progname. command will be executed for any program which matches prog. prog may also be a basic regular expression, in which case command will be executed for any program that matches the regular expression. If prog is absent, command is executed for all programs.
Some arguments (see below) interpret certain substrings as control char- acters. Specifically, a caret ('^') converts the following character to the corresponding C0, C1 or DEL control ('^?' to DEL, everything else is ANDed with 0x9F); a backslash ('\') starts one of these sequences: \a Bell (same as ^G) \b Backspace (same as ^H) \e Escape (same as ^[) \E Escape (extension, same as above) \f Form feed (same as ^L) \n Line feed / Newline (same as ^J) \r Carriage return (same as ^M) \t Horizontal tabulator (same as ^I) \v Vertical tabulator (same as ^K) \nnn The ASCII character corresponding to the octal number nnn. \U+nnnn or \U-nnnnn The UCS codepoint corresponding to the hex number nnnn(n). It is an error to have a backslash or caret at the end of the input string, that is, followed by the null character. Any other character after a backslash is interpreted as-is, i.e. losing its special meaning if it has any, notably '\' and '^'.
The editline library has some builtin commands, which affect the way that the line editing and history functions operate. These are based on simi- lar named builtins present in the tcsh(1) shell. The following builtin commands are available: bind [-elv] bind [-akrs] key [command] Without options and arguments, list all bound keys (in both maps) and macros and the editor command or input string to which each one is bound. If only key is supplied, show the binding for that key or macro. If key and command are supplied, bind the editor command to that key or macro. The options are as follows: -a List or change key bindings in the alternate (vi command mode) key map. This map will be unused in emacs mode. -e Bind all keys to the standard GNU Emacs-like bindings. -k key is interpreted as a symbolic key name, which may be one of: 'up', 'down', 'left', 'right', 'home', 'end', 'delete' -l List all editor commands and a short description of each. -r Remove the binding of the key or macro key. -s Define a keyboard macro rather than a key binding or command macro: command is taken as a literal string and appended to the input queue whenever key is typed. Bound keys and macros in command are themselves reinterpreted, and this continues for ten levels of interpretation. -v Bind all keys to the standard vi(1)-like bindings. The editline(7) manual documents all editor commands and contains more information about macros and the input queue. key and command may contain ESCAPES (see above). echotc [-sv] arg ... Exercise terminal capabilities given in arg .... If arg is 'baud', 'cols', 'lines', 'rows', 'meta', or 'tabs', the value of that capa- bility is printed, with "yes" or "no" indicating that the terminal does or does not have that capability. -s suppresses error messages; -v enables extra termcap diagnostics. edit [on | off] Enable or disable the editline functionality in a program. history [list] List all entries in the history. history size n Set the history size to n entries. history unique n Control whether history should keep duplicate entries. If n is nonzero, only keep unique history entries. If n is zero, then keep all entries (the default). settc cap val Set the terminal capability cap to val, as defined in termcap(5). No sanity checking is done. setty [-a] [-d] [-q] [-x] [+mode] [-mode] [mode] [char=[c]] Control which tty modes that editrc won't allow the user to change. -d, -q or -x tells setty to act on the 'edit', 'quote' or 'execute' set of tty modes respectively; defaulting to -x. Without other arguments, setty lists the modes in the chosen set which are fixed on ('+mode') or off ('-mode'). -a lists all tty modes in the chosen set regardless of the setting. With +mode, - mode or mode, fixes mode on or off or removes control of mode in the chosen set. setty can also be used to set tty characters to particular values using char=value. If value is empty then the character is set to _POSIX_VDISABLE. value may contain ESCAPES (see above). telltc List the values of all the terminal capabilities (see termcap(5)).
EDITRC Names the default configuration file for the editline(3) library. HOME Used to find last resort configuration file (see below). TERM Used to determine term(7) name and corresponding settings.
~/.etc/editrc Last resort, if no other file is specified (see above), user configuration file for the editline(3) library.
editline(3), termcap(5), editline(7), re_format(7)
The editline library was written by Christos Zoulas, and this manual was written by Luke Mewburn, with some sections inspired by tcsh(1). MirBSD #10-current July 9, 2021 2