man-pages/man1/ledit.1.html
2021-03-31 01:06:50 +01:00

317 lines
10 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of LEDIT</TITLE>
</HEAD><BODY>
<H1>LEDIT</H1>
Section: User Commands (1)<BR>Updated: Wed Jan 23, 2008<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ledit - line editor, version 2.04
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>ledit</B>
[-h <I>file</I>]
[-x]
[-t]
[-l <I>length</I>]
[-a | -u]
[<I>command options</I>]
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The command <I>ledit</I> allows one to edit lines one by one when running an
interactive command. When typing a line, some keys with control or meta
are interpreted: it is possible to insert characters in the middle of
the line, go to the beginning or the end of the line, get a previous line,
search for a line with a pattern, etc.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
The options are:
<DL COMPACT>
<DT id="1"><B>-h </B><I>file</I>
<DD>
Save the lines typed (history) in <I>file</I>. The default is to have them
only in memory (so, they are lost at the end of the program).
<DT id="2"><B>-x</B>
<DD>
Extend the history file (given in option &quot;-h&quot;) if it already exists. The
default is to truncate the history file.
<DT id="3"><B>-t</B>
<DD>
Display the sequences generated by the keys (for debugging).
<DT id="4"><B>-v</B>
<DD>
Print ledit version and exit.
<DT id="5"><B>-l </B><I>length</I>
<DD>
Tells that <I>length</I> is the maximum line length displayed. If the
line edited is longer than this length, the line scrolls horizontally,
while editing. The default value is 70.
<DT id="6"><B>-a</B>
<DD>
Ascii encoding: characters whose code is greater than 128 are displayed
with a backslash followed by their code.
<DT id="7"><B>-u</B>
<DD>
Unicode encoding: the terminal must have been set in unicode mode. See
commands <B>unicode_start</B> and <B>unicode_stop</B>.
<DT id="8"><I>command options</I><DD>
Runs the command <I>command</I> and its possible options. This
must be the last option of ledit. The default value is &quot;cat&quot;.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>KEYS BINDINGS</H2>
When ledit starts, some default key bindings are defined. The can be
completed with a &quot;leditrc&quot; file. See the section <B>LEDITRC</B>.
<P>
In the following lines, the caret sign &quot;^&quot; means &quot;control&quot; and the
sequence &quot;M-&quot; means &quot;meta&quot; (either with the &quot;meta&quot; prefix, or by
pressing the &quot;escape&quot; key before). Examples:
<DL COMPACT>
<DT id="9">^a<DD>
press the &quot;control&quot; key, then press &quot;a&quot;, then release &quot;a&quot;, then
release &quot;control&quot;.
<DT id="10">M-a<DD>
press the &quot;meta&quot; key, then press &quot;a&quot;, then release &quot;a&quot;, then release
&quot;meta&quot;, or: press and release the &quot;escape&quot; key, then press and release
&quot;a&quot; (the manipulation with &quot;meta&quot; may not work in some systems: in
this case, use the manipulation with &quot;escape&quot;).
</DL>
<P>
<P>
The default editing commands are:
<P>
<PRE>
^a : beginning of line
^e : end of line
^f : forward char
^b : backward char
M-f : forward word
M-b : backward word
TAB : complete file name
^p : previous line in history
^n : next line in history
M-&lt; : first line in history
M-&gt; : 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 chars
M-c : capitalize word
M-u : upcase word
M-l : downcase word
M-d : kill word
M-^h : (or M-del or M-backspace) backward kill word
^q : insert next char
M-/ : expand abbreviation
^k : cut until end of line
^y : paste
^u : line discard
^l : redraw current line
^g : abort prefix
^c : interrupt
^z : suspend
^\ : quit
return : send line
^x : send line and show next history line
other : insert char
</PRE>
<P>
The arrow keys can be used, providing your keyword returns standard key
sequences:
<P>
<PRE>
up arrow : previous line in history
down arrow : next line in history
right arrow : forward char
left arrow : backward char
</PRE>
<P>
Other keys:
<P>
<PRE>
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
</PRE>
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>REVERSE SEARCH</H2>
The reverse search in incremental, i.e. <I>ledit</I> backward searches in the
history a line holding the characters typed. If you type &quot;a&quot;, its search the
first line before the current line holding an &quot;a&quot; and displays it. If you then
type a &quot;b&quot;, its search a line holding &quot;ab&quot;, and so on. If you type ^h (or
backspace), it returns to the previous line found. To cancel the search,
type ^g. To find another line before holding the same string, type ^r.
To stop the editing and display the current line found, type &quot;escape&quot;
(other commands of the normal editing, different from ^h, ^g, and ^r stop
the editing too).
<P>
Summary of reverse search commands:
<P>
<PRE>
^g : abort search
^r : search previous same pattern
^h : (or backspace) search without the last char
del : search without the last char
any other command : stop search and show the line found
</PRE>
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>LEDITRC</H2>
If the environment variable LEDITRC is set, it contains the name of the
leditrc file. Otherwise it is the file named &quot;.leditrc&quot; in user's home
directory. When starting, ledit reads this file, if it exists, to modify
or complete the default bindings. If this file is changed while reading
lines, it is read again to take the new file into account.
<P>
Bindings lines are the ones which start with a string defining the key
sequence and follow with a colon and a binding. A binding is either a
string or a command. The other lines are ignored For example,the line:
<P>
<PRE>
&quot;\C-a&quot;: beginning-of-line
</PRE>
<P>
binds the sequence &quot;control-a&quot; to the command &quot;beginning-of-line&quot;.
<P>
The key sequence may contain the specific meta-sequences:
<P>
<PRE>
\C- followed by a key: &quot;control&quot; of this key
\M- followed by a key: &quot;meta&quot; of this key
\e the &quot;escape&quot; 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
</PRE>
<P>
The commands are:
<P>
<PRE>
abort: do nothing
accept-line: send the current line
backward-char: move the cursor to the previous character
backward-delete-char: delete the previous character
backward-kill-word: delete the previous word
backward-word: move the cursor before the previous word
beginning-of-history: display the first line of the history
beginning-of-line: move the cursor at the beginning of the line
capitalize-word: uppercase the first char and lowercase the rest
delete-char: delete the character under the cursor
delete-char-or-end-of-file: same but eof if no character in the line
downcase-word: lowercase whole word
end-of-history: display the last line of the history
end-of-line: move the cursor to the end of the line
expand-abbrev: try to complete the word by looking at the history
expand-to-file-name: try to complete the word from a file name
forward-char: move the cursor after the next word
forward-word: move the cursor to the next character
interrupt: interrupt command (send control-C)
kill-line: delete from the cursor to the end and save in buffer
kill-word: delete the next word
next-history: display the next line of the history
operate-and-get-next: send line and display the next history line
previous-history: display the previous line of the history
quit: quit ledit
quoted-insert: insert the next character as it is
redraw-current-line: redisplay the current line
reverse-search-history: backward search in the history
suspend: suspend ledit (send control-Z)
transpose-chars: exchange the last two characters
unix-line-discard: kill current line
upcase-word: uppercase whole word
yank: insert kill buffer
</PRE>
<P>
<A NAME="lbAI">&nbsp;</A>
<H2>KNOWN BUGS</H2>
If <I>ledit</I> has been launched in a shell script, the suspend command kills
it and its command... Use &quot;exec ledit comm&quot; instead of &quot;ledit comm&quot;.
<BR>
The suspend command stops <I>ledit</I> but not the called program. Do not
do this if the called program is not waiting on standard input.
<BR>
In some systems (e.g. alpha), pasting two many characters works bad and
may block the terminal. Probably a kernel problem. No solution.
<P>
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<A HREF="/cgi-bin/man/man2html?1+unicode_start">unicode_start</A>(1), <A HREF="/cgi-bin/man/man2html?1+unicode_stop">unicode_stop</A>(1).
<P>
<A NAME="lbAK">&nbsp;</A>
<H2>AUTHOR</H2>
Daniel de Rauglaudre, at INRIA, France.
<BR>
<A HREF="mailto:daniel.de_rauglaudre@inria.fr">daniel.de_rauglaudre@inria.fr</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="11"><A HREF="#lbAB">NAME</A><DD>
<DT id="12"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="13"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="14"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="15"><A HREF="#lbAF">KEYS BINDINGS</A><DD>
<DT id="16"><A HREF="#lbAG">REVERSE SEARCH</A><DD>
<DT id="17"><A HREF="#lbAH">LEDITRC</A><DD>
<DT id="18"><A HREF="#lbAI">KNOWN BUGS</A><DD>
<DT id="19"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="20"><A HREF="#lbAK">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:18 GMT, March 31, 2021
</BODY>
</HTML>