LEDIT(1)
π NAME π
okay bestie, gather round, this is the manual page for ledit(1) β the command is ledit, and it's a line editor, currently at version 2.04. lowercase name, big personality, we love her.
β¨ SYNOPSIS β¨
ledit [-h file] [-x] [-t] [-l length] [-a | -u] [command options]
π¦ DESCRIPTION π¦
so the way ledit works is: you're running some interactive command, and ledit lets you edit the lines one by one as you go. while you're typing a line, certain keys β the control ones and the meta ones β actually mean something. like, you can insert characters in the middle of the line (yes, mid-line, no more rage-deleting), jump to the beginning or the end of the line, pull up a previous line, search for a line matching a pattern, etc. it's giving actual editor but make it terminal. π
π OPTIONS π
here's the full menu, no skipping:
-hfile β saves the lines you type (aka the history) into file. the default is that they just vibe in memory only, which means they're gone the second the program ends π.-xβ extends the history file (the one you gave to-h) if it already exists. the default behaviour is to truncate that history file instead.-tβ displays the sequences that the keys generate. this one's for debugging, iykyk.-vβ prints theleditversion and dips out. βοΈ-llength β tells it that length is the maximum line length that gets displayed. if the line you're editing is longer than that, the line scrolls horizontally while you edit. default is70.-aβ ascii encoding: any character whose code is greater than 128 gets displayed as a backslash followed by its code.-uβ unicode encoding: your terminal must have been set in unicode mode first. see the commandsunicode_startandunicode_stop. πcommand optionsβ runs the command command along with its possible options. this has to be the last option ofledit. the default value is"cat".
β¨οΈ KEYS BINDINGS β¨οΈ
when ledit starts up, a bunch of default key bindings are already defined. you can complete them with a "leditrc" file β that whole situation is in the LEDITRC section below. π
just so we're speaking the same language: the caret sign ^ means "control", and the sequence M- means "meta" (either via the "meta" prefix, or by pressing the "escape" key beforehand). examples, because bestie deserves clarity:
^aβ press the"control"key, then press"a", then release"a", then release"control".M-aβ press the"meta"key, then press"a", then release"a", then release"meta". OR: press and release the"escape"key, then press and release"a". heads up though β the"meta"manipulation may not work on some systems, and in that case you just use the"escape"manipulation instead. π
the default editing commands are:
^aβ beginning of line^eβ end of line^fβ forward char^bβ backward charM-fβ forward wordM-bβ backward wordTABβ complete file name^pβ previous line in history^nβ next line in historyM-<β first line in historyM->β last line in history^rβ reverse search in history (see below)^dβ delete char (or EOF if the line is empty)^hβ (or backspace) backward delete char^tβ transpose charsM-cβ capitalize wordM-uβ upcase wordM-lβ downcase wordM-dβ kill wordM-^hβ (or M-del or M-backspace) backward kill word^qβ insert next charM-/β expand abbreviation^kβ cut until end of line^yβ paste^uβ line discard^lβ redraw current line^gβ abort prefix^cβ interrupt^zβ suspend^\β quitreturnβ send line^xβ send line and show next history lineotherβ insert char
πΈ Arrow Keys πΈ
the arrow keys work too β as long as your keyboard returns standard key sequences:
- up arrow β previous line in history
- down arrow β next line in history
- right arrow β forward char
- left arrow β backward char
π§ Other Keys π§
- home β beginning of line
- end β end of line
- delete β delete char
- page up β previous line in history
- page down β next line in history
- shift home β beginning of history
- shift end β end of history
π REVERSE SEARCH π
the reverse search is incremental, meaning ledit searches backwards through the history for a line holding the characters you've typed. type "a" and it finds the first line before the current one that holds an "a" and shows it to you. then type a "b" and it searches for a line holding "ab", and so on, building the pattern as you go. β¨
if you type ^h (or backspace), it goes back to the previous line it found. to cancel the whole search, type ^g. to find another line before the current one holding the same string, type ^r. and to stop editing and display the current line it found, type "escape" β though ngl, other commands of the normal editing also stop the editing, as long as they're not ^h, ^g, or ^r.
summary of reverse search commands:
^gβ abort search^rβ search previous same pattern^hβ (or backspace) search without the last chardelβ search without the last char- any other command β stop search and show the line found
π LEDITRC π
if the environment variable LEDITRC is set, it holds the name of the leditrc file. otherwise, it's the file named ".leditrc" sitting in your home directory. π
when it starts, ledit reads that file (if it exists, obviously) to modify or complete the default bindings. and here's the cute part: if that file gets changed while you're reading lines, it gets read again so the new file is taken into account. it's keeping up with you fr fr. π
binding lines are the ones that start with a string defining the key sequence, followed by a colon and then a binding. a binding is either a string or a command. every other line? ignored, no thoughts, head empty. for example, this line:
"\C-a": beginning-of-line
binds the sequence "control-a" to the command "beginning-of-line".
the key sequence may contain these specific meta-sequences:
\C- followed by a key: "control" of this key
\M- followed by a key: "meta" of this key
\e the "escape" key
\nnn where nnn is one, two, or three octal digits, or:
\xnn where nn is one or two hexadecimal digits:
the binary representation of a byte
\a bell = \C-g
\b backspace = \C-h
\d delete = \277
\f form feed = \C-l
\n newline = \C-j
\r carriage return = \C-m
\t tabulation = \C-i
\v vertical tabulation = \C-k
and here come the commands, the whole squad, all of them:
abort: do nothingaccept-line: send the current linebackward-char: move the cursor to the previous characterbackward-delete-char: delete the previous characterbackward-kill-word: delete the previous wordbackward-word: move the cursor before the previous wordbeginning-of-history: display the first line of the historybeginning-of-line: move the cursor at the beginning of the linecapitalize-word: uppercase the first char and lowercase the restdelete-char: delete the character under the cursordelete-char-or-end-of-file: same but eof if no character in the linedowncase-word: lowercase whole wordend-of-history: display the last line of the historyend-of-line: move the cursor to the end of the lineexpand-abbrev: try to complete the word by looking at the historyexpand-to-file-name: try to complete the word from a file nameforward-char: move the cursor after the next wordforward-word: move the cursor to the next characterinterrupt: interrupt command (send control-C)kill-line: delete from the cursor to the end and save in bufferkill-word: delete the next wordnext-history: display the next line of the historyoperate-and-get-next: send line and display the next history lineprevious-history: display the previous line of the historyquit: quit leditquoted-insert: insert the next character as it isredraw-current-line: redisplay the current linereverse-search-history: backward search in the historysuspend: suspend ledit (send control-Z)transpose-chars: exchange the last two charactersunix-line-discard: kill current lineupcase-word: uppercase whole wordyank: insert kill buffer
π KNOWN BUGS π
okay bestie, this is the scary part, pay attention:
- if
ledithas been launched inside a shell script, thesuspendcommand kills it and its command. the fix: useexec ledit comminstead ofledit comm. π - the
suspendcommand stopsleditbut not the program it called. so do not do this if the called program is not waiting on standard input. - on some systems (e.g.
alpha), pasting too many characters works badly and may block the terminal. probably a kernel problem. no solution. not me finding out the hard way π.
π SEE ALSO π
unicode_start(1), unicode_stop(1)
π AUTHOR π
Daniel de Rauglaudre, at INRIA, France. daniel.de_rauglaudre@inria.fr
and that's the whole page, periodt. π«Ά this one came straight outta INRIA, dated Wed Jan 23, 2008 β vintage but still slaying. πβ¨
π¦ where this page comes from
- debian bookworm: ledit 2.04-6 Β· BSD-3-Clause
- debian trixie: ledit 2.04-8+b12 Β· BSD-3-Clause
- ubuntu jammy: ledit 2.04-6build2 Β· BSD-3-Clause
- ubuntu noble: ledit 2.04-7build5 Β· BSD-3-Clause
- ubuntu questing: ledit 2.04-8build13
- ubuntu resolute: ledit 2.04-8build18 Β· BSD-3-Clause
- ubuntu stonking: ledit 2.04-8build21 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms