EDITRC(5edit)
β¨ NAME β¨
Okay bestie, welcome to EDITRC(5edit) from the LOCAL section π
. This page is all about editrc, the configuration file for the editline library π.
πΈ SYNOPSIS πΈ
editrc
π DESCRIPTION π
So the editrc file is where you set up a bunch of different settings for the editline(3edit) library π«Ά.
Every line follows this vibe:
[prog:]command [arg ...]
The command part is one of the editline(3edit) builtin commands β¨. Check out βBUILTIN COMMANDSβ below for all the deets.
The prog part is the program name that a program sets when it calls el_init(3) to get editline(3edit) going, which is usually argv[0] π¦. That command runs for any program that matches prog.
Lowkey fancy move: prog can also be a regex(3) style regular expression π§. If it's a regex, the command runs for any program that matches the pattern.
If prog is missing, the command runs for every single program π.
π BUILTIN COMMANDS π
Editline has some builtin commands that change how the line editing and history stuff works π . They're based on similarly named builtins in the tcsh(1) shell, so if you know tcsh, you're already ahead bestie π₯.
Here are the builtins you can use:
bind [-aeklrsv] [key [command]]
bind [-aeklrsv] [key [command]]
No options and no arguments? It lists every bound key and macro, plus the editor command or input string each one is tied to π. If you only give it key, it shows you the binding for just that key or macro π. If you give it key and command, it binds that editor command to the key or macro π.
Here's what the options do:
-aβ Lists or changes key bindings in the vi(1) mode alternate (command mode) key map π¦.-eβ Binds all keys to the standard GNU Emacs-like bindings π.-kβ Treats key as a symbolic arrow key name. It can beup,down,leftorrightβ.-lβ Lists all editor commands with a short description of each π.-rβ Removes the binding of the key or macro key ποΈ.-sβ Defines a keyboard macro instead of a key binding or command macro π. The command is treated as a literal string and gets added to the input queue whenever key is typed. Bound keys and macros inside command get reinterpreted too, and this keeps going for ten levels of interpretation π« .-vβ Binds all keys to the standard vi(1)-like bindings π.
The editline(7edit) manual has every editor command and way more info on macros and the input queue, so go peek there if you're curious π.
key and command can use control characters like ^A (the ^character form), plus these backslash escapes:
\aβ Bell π\bβ Backspace β¬ οΈ\eβ Escape πͺ\fβ Formfeed π\nβ Newline β\rβ Carriage return π\tβ Horizontal tab β‘οΈ\vβ Vertical tab βοΈ\nnnβ The ASCII character matching the octal number nnn π’
β οΈ A\cancels the special meaning of whatever character comes after it, if that character has one. The big ones are\and^, so be careful!
echotc [-sv] arg ...
echotc [-sv] arg ...
This one exercises the terminal capabilities you give it as arg π₯οΈ. If arg is baud, cols, lines, rows, meta or tabs, it prints that capability's value. It'll also print "yes" or "no" depending on whether the terminal has that capability π
.
-sβ Returns an empty string for capabilities that don't exist, instead of throwing an error π«§.-vβ Makes the messages verbose π’.
edit [on | off]
edit [on | off]
Turns the editline functionality on or off in a program ποΈ.
history list | size n | unique n
history list | size n | unique n
listlists all the entries in the history π.size nsets the history size to n entries π.unique ndecides whether history can keep duplicate entries π ββοΈ. If n is non zero, only unique entries get kept. If n is zero, then every entry is kept, and that's the default π.
settc cap val
settc cap val
Sets the terminal capability cap to val, as defined in termcap(5) π§. There's no sanity checking, so you're on your own here bestie π.
setty [-a] [-d] [-q] [-x] [+mode] [-mode] [mode] [char=c]
setty [-a] [-d] [-q] [-x] [+mode] [-mode] [mode] [char=c]
This controls which tty modes editrc won't let the user change π. -d, -q or -x tells setty which set of tty modes to act on: edit, quote or execute respectively. It defaults to -x β¨.
- With no other arguments, setty lists the modes in the chosen set that are fixed on (
+mode) or fixed off (-mode) π. -aβ Lists all tty modes in the chosen set, no matter what their setting is π.- With
+mode,-modeormode, it fixes the mode on or off, or removes control of that mode from the chosen set π.
setty can also set tty characters to specific values using char=value π―. If value is empty, the character gets set to _POSIX_VDISABLE π.
telltc
telltc
Lists the values of all the terminal capabilities (see termcap(5)) π.
π§ ENVIRONMENT π§
EDITRCβ Names the default configuration file for the editline(3edit) library π.
π¦ FILES π¦
~/.editrcβ Your last resort user configuration file for the editline(3edit) library, used when no other file is specified π‘.
π SEE ALSO π
editline(3edit), regex(3), termcap(5), editline(7edit) π
π«Ά AUTHORS π«Ά
The editline library was written by Christos Zoulas π. This manual was written by Luke Mewburn, with some sections inspired by tcsh(1) π.
Okay bestie, that's the whole editrc tea β. Source: Debian, dated May 22, 2016, and it's still EDITRC(5edit) forever πΈπ β¨
π¦ where this page comes from
- debian trixie: libedit2 3.1-20250104-1
- ubuntu noble: libedit2 3.1-20230828-1build1
- ubuntu questing: libedit2 3.1-20250104-1build1
- ubuntu resolute: libedit2 3.1-20251016-1
- ubuntu stonking: libedit2 3.1-20260512-1
- Copyright (c) 1997-2000 The NetBSD Foundation, Inc
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms