EDITRC(5edit)

πŸ“¦
version 3.1-20260512 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 be up, down, left or right ⭐.
  • -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
  • list lists all the entries in the history πŸ“š.
  • size n sets the history size to n entries πŸ“.
  • unique n decides 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, -mode or mode, 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