317 lines
10 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ledit - line editor, version 2.04
|
|
<P>
|
|
<A NAME="lbAC"> </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"> </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"> </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 "-h") 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 "cat".
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>KEYS BINDINGS</H2>
|
|
|
|
When ledit starts, some default key bindings are defined. The can be
|
|
completed with a "leditrc" file. See the section <B>LEDITRC</B>.
|
|
<P>
|
|
In the following lines, the caret sign "^" means "control" and the
|
|
sequence "M-" means "meta" (either with the "meta" prefix, or by
|
|
pressing the "escape" key before). Examples:
|
|
<DL COMPACT>
|
|
<DT id="9">^a<DD>
|
|
press the "control" key, then press "a", then release "a", then
|
|
release "control".
|
|
<DT id="10">M-a<DD>
|
|
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" (the manipulation with "meta" may not work in some systems: in
|
|
this case, use the manipulation with "escape").
|
|
</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-< : first line in history
|
|
M-> : 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"> </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 "a", its search the
|
|
first line before the current line holding an "a" and displays it. If you then
|
|
type a "b", its search a line holding "ab", 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 "escape"
|
|
(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"> </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 ".leditrc" 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>
|
|
"\C-a": beginning-of-line
|
|
</PRE>
|
|
|
|
<P>
|
|
binds the sequence "control-a" to the command "beginning-of-line".
|
|
<P>
|
|
The key sequence may contain the specific meta-sequences:
|
|
<P>
|
|
<PRE>
|
|
\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
|
|
</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"> </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 "exec ledit comm" instead of "ledit comm".
|
|
<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"> </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"> </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"> </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>
|