EDITRC(5)

πŸ“¦
version 20260512_3.1 Β· 4 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, freebsd 14.5, freebsd 15.1

πŸ’– EDITRC πŸ’–

okay bestie, so this is the manual page for editrc, aka the configuration file for the editline library. and yeah, it's a file formats manual, so buckle up, it's giving ✨setup✨ energy.


πŸ¦‹ SYNOPSIS πŸ¦‹

editrc

🌸 DESCRIPTION 🌸

so editrc is literally the file where you define all the various settings that the editline(3) library is gonna use. it's your vibe-setting zone, no cap.

the format of each line is, and i quote:

[prog:]command [arg ...]

command is one of the editline(3) builtin commands. go peek at β€œBUILTIN COMMANDS” below for the full tea, i promise it's worth it.

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]. so command gets executed for any program that matches prog. matching energy only. πŸ’…

prog may also be a regex(3) style regular expression, and in that case command will be executed for any program that matches the regular expression. regex girlies stay winning. 🌈

and if prog is just... absent? then command is executed for all programs. everyone gets a piece. πŸ‘‘


πŸŽ€ BUILTIN COMMANDS πŸŽ€

the editline library has some builtin commands, and they affect the way that the line editing and history functions operate. these are based on similar named builtins present in the tcsh(1) shell. slay, we love a crossover.

the following builtin commands are available:

  • bind [-aeklrsv] [key [command]] β€” okay so with no options and no arguments, this lists all bound keys and macros, plus the editor command or input string to which each one is bound. if you only supply key, it shows the binding for that key or macro. and if you supply key command, it binds the editor command to that key or macro. it's giving matchmaker but for keys fr fr.

the options are as follows:

  • -a β€” List or change key bindings in the vi(1) mode alternate (command mode) key map.
  • -e β€” Bind all keys to the standard GNU Emacs-like bindings.
  • -k β€” key is interpreted as a symbolic arrow key name, which may be one of up, down, left or right. 🧭
  • -l β€” List all editor commands and a short description of each.
  • -r β€” Remove the binding of the key or macro key. it's giving goodbye, not me deleting the binding 😭
  • -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. ten! levels! recursion queen πŸ’€
  • -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. iykyk, go read it. πŸ“š

key and command can contain control characters of the form β€˜^character’ (e.g. β€˜^A’), and the following backslashed escape sequences:

  • \a β€” Bell
  • \b β€” Backspace
  • \e β€” Escape
  • \f β€” Formfeed
  • \n β€” Newline
  • \r β€” Carriage return
  • \t β€” Horizontal tab
  • \v β€” Vertical tab
  • \nnn β€” The ASCII character corresponding to the octal number nnn.

and β€˜\’ nullifies the special meaning of the following character, if it has any, notably β€˜\’ and β€˜^’. so it's basically the "actually never mind, this one's normal" button. 🫢

  • echotc [-sv] arg ... β€” Exercise terminal capabilities given in arg. if arg is β€˜baud’, β€˜cols’, β€˜lines’, β€˜rows’, β€˜meta’, or β€˜tabs’, the value of that capability is printed, with β€œyes” or β€œno” indicating that the terminal does or does not have that capability. vibe check on your terminal, basically. πŸ–₯️✨

-s returns an empty string for non-existent capabilities, rather than causing an error. -v causes messages to be verbose.

  • edit [on | off] β€” Enable or disable the editline functionality in a program. the on/off switch, the main character toggle. πŸ”₯
  • history list | size n | unique n β€” the β€˜list’ command lists all entries in the history. the β€˜size’ command sets the history size to n entries. the β€˜unique’ command controls if history should keep duplicate entries. if n is non zero, only keep unique history entries. if n is zero, then keep all entries (the default). so zero = no filter, we're accepting everyone into the history πŸ’–
  • settc cap val β€” Set the terminal capability cap to val, as defined in termcap(5).
no sanity checking is done. none. zero. it will simply do the thing you asked for and you will have to live with that πŸ’€
  • 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. ✨

  • telltc β€” List the values of all the terminal capabilities (see termcap(5)). the full rundown, the terminal lore dump. πŸ“œ

🌈 ENVIRONMENT 🌈

  • EDITRC β€” Names the default configuration file for the editline(3) library.

πŸ“ FILES πŸ“

  • ~/.editrc β€” Last resort user configuration file for the editline(3) library if no other file is specified. the final boss of config files. πŸ‘‘

πŸ’œ SEE ALSO πŸ’œ

editline(3), regex(3), termcap(5), editline(7)


πŸ‘‘ AUTHORS πŸ‘‘

The editline library was written by Christos Zoulas, and this manual was written by Luke Mewburn, with some sections inspired by tcsh(1). iconic collaborators honestly 🫢


and that's the whole thing bestie! this page came from Debian, dated May 22, 2016, and it's page EDITRC(5) of the file formats manual. go forth and configure, you absolute legend πŸ’…βœ¨

πŸ“¦ where this page comes from