2534 lines
40 KiB
HTML
2534 lines
40 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of EDITLINE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>EDITLINE</H1>
|
|
Section: Misc. Reference Manual Pages (7edit)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
<BR>BSD mandoc<BR>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
|
|
|
|
<B>editline</B>
|
|
|
|
- line editing user interface
|
|
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
When a program using the
|
|
editline(3edit)
|
|
|
|
|
|
library prompts for an input string using the function
|
|
el_wgets3,
|
|
|
|
|
|
it reads characters from the terminal.
|
|
Invalid input bytes that do not form characters are silently
|
|
discarded.
|
|
For each character read, one editor command is executed.
|
|
The mapping of input characters to editor commands depends on the
|
|
editing mode.
|
|
There are three editing modes: vi insert mode, vi command mode,
|
|
and emacs mode.
|
|
The default is vi insert mode.
|
|
The program can switch the default to emacs mode by using the
|
|
el_set3
|
|
|
|
|
|
or
|
|
el_parse3
|
|
|
|
|
|
functions, and the user can switch to emacs mode either in the
|
|
editrc(5edit)
|
|
|
|
|
|
configuration file or interactively with the
|
|
<B>ed-command</B>
|
|
|
|
editor command, in all three cases executing the
|
|
<B>bind -e</B>
|
|
|
|
|
|
|
|
builtin command.
|
|
<P>
|
|
|
|
If trying to read from the terminal results in end of file or an
|
|
error, the library signals end of file to the program and does not
|
|
return a string.
|
|
<A NAME="lbAD"> </A>
|
|
<H3>Input character bindings</H3>
|
|
|
|
All default bindings described below can be overridden by individual
|
|
programs and can be changed with the
|
|
editrc(5edit)
|
|
|
|
|
|
<B>bind</B>
|
|
|
|
builtin command.
|
|
<P>
|
|
|
|
In the following tables,
|
|
`Ctrl-'
|
|
|
|
indicates a character with the bit 0x40 flipped, and
|
|
`Meta-'
|
|
|
|
indicates a character with the bit 0x80 set.
|
|
In vi insert mode and in emacs mode, all Meta-characters considered
|
|
printable by the current
|
|
<A HREF="/cgi-bin/man/man2html?1+locale">locale</A>(1)
|
|
|
|
|
|
are bound to
|
|
<B>ed-insert</B>
|
|
|
|
instead of to the editor command listed below.
|
|
Consequently, in UTF-8 mode, most of the Meta-characters are not
|
|
directly accessible because their code points are occupied by
|
|
printable Unicode characters, and Meta-characters are usually input
|
|
using the
|
|
<B>em-meta-next</B>
|
|
|
|
editor command.
|
|
For example, to enter
|
|
`Meta-B'
|
|
|
|
in order to call the
|
|
<B>ed-prev-word</B>
|
|
|
|
editor command in emacs mode, call
|
|
<B>em-meta-next</B>
|
|
|
|
by pressing and releasing the escape key (or equivalently, Ctrl-[),
|
|
then press and release the
|
|
`B'
|
|
|
|
key.
|
|
If you have configured a Meta-key on your keyboard, for example
|
|
with
|
|
`setxkbmap'
|
|
|
|
-option altwin:left_meta_win ,
|
|
the Ctrl-Meta-characters are directly accessible.
|
|
For example, to enter
|
|
`Ctrl-Meta-H'
|
|
|
|
in order to call the
|
|
<B>ed-delete-prev-word</B>
|
|
|
|
editor command in emacs mode, hold down the keys
|
|
`Ctrl'
|
|
|
|
|
|
`Meta'
|
|
|
|
|
|
and
|
|
`H'
|
|
|
|
at the same time.
|
|
Alternatively, press and release the escape key, then press and
|
|
release
|
|
`Ctrl-H'
|
|
|
|
|
|
<P>
|
|
|
|
In vi input mode, input characters are bound to the following editor
|
|
commands by default:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="1"><B>Ctrl-D, EOF Ta </B><B>vi-list-or-eof</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="2"><B>Ctrl-H, BS Ta </B><B>vi-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="3"><B>Ctrl-J, LF Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="4"><B>Ctrl-M, CR Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="5"><B>Ctrl-Q Ta </B><B>ed-tty-start-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="6"><B>Ctrl-S Ta </B><B>ed-tty-stop-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="7"><B>Ctrl-U Ta </B><B>vi-kill-line-prev</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="8"><B>Ctrl-V Ta </B><B>ed-quoted-insert</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="9"><B>Ctrl-W Ta </B><B>ed-delete-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="10"><B>Ctrl-[, ESC Ta </B><B>vi-command-mode</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="11"><B>Ctrl-\, QUIT Ta </B><B>ed-tty-sigquit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="12"><B>Ctrl-?, DEL Ta </B><B>vi-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
|
|
All other input characters except the NUL character (Ctrl-@) are
|
|
bound to
|
|
<B>ed-insert</B>
|
|
|
|
|
|
<P>
|
|
|
|
In vi command mode, input characters are bound to the following
|
|
editor commands by default:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="13"><B>Ctrl-A Ta </B><B>ed-move-to-beg</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="14"><B>Ctrl-C, INT Ta </B><B>ed-tty-sigint</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="15"><B>Ctrl-E Ta </B><B>ed-move-to-end</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="16"><B>Ctrl-H, BS Ta </B><B>ed-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="17"><B>Ctrl-J, LF Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="18"><B>Ctrl-K Ta </B><B>ed-kill-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="19"><B>Ctrl-L, FF Ta </B><B>ed-clear-screen</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="20"><B>Ctrl-M, CR Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="21"><B>Ctrl-N Ta </B><B>ed-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="22"><B>Ctrl-O Ta </B><B>ed-tty-flush-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="23"><B>Ctrl-P Ta </B><B>ed-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="24"><B>Ctrl-Q Ta </B><B>ed-tty-start-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="25"><B>Ctrl-R Ta </B><B>ed-redisplay</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="26"><B>Ctrl-S Ta </B><B>ed-tty-stop-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="27"><B>Ctrl-U Ta </B><B>vi-kill-line-prev</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="28"><B>Ctrl-W Ta </B><B>ed-delete-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="29"><B>Ctrl-[, ESC Ta </B><B>em-meta-next</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="30"><B>Ctrl-\, QUIT Ta </B><B>ed-tty-sigquit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="31"><B>Space Ta </B><B>ed-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="32"><B># Ta </B><B>vi-comment-out</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="33"><B>$ Ta </B><B>ed-move-to-end</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="34"><B>% Ta </B><B>vi-match</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="35"><B>+ Ta </B><B>ed-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="36"><B>, Ta </B><B>vi-repeat-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="37"><B>- Ta </B><B>ed-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="38"><B>. Ta </B><B>vi-redo</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="39"><B>/ Ta </B><B>vi-search-prev</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="40"><B>0 Ta </B><B>vi-zero</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="41"><B>1 to 9 Ta </B><B>ed-argument-digit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="42"><B>: Ta </B><B>ed-command</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="43"><B>; Ta </B><B>vi-repeat-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="44"><B>? Ta </B><B>vi-search-next</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="45"><B>@ Ta </B><B>vi-alias</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="46"><B>A Ta </B><B>vi-add-at-eol</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="47"><B>B Ta </B><B>vi-prev-big-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="48"><B>C Ta </B><B>vi-change-to-eol</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="49"><B>D Ta </B><B>ed-kill-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="50"><B>E Ta </B><B>vi-end-big-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="51"><B>F Ta </B><B>vi-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="52"><B>G Ta </B><B>vi-to-history-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="53"><B>I Ta </B><B>vi-insert-at-bol</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="54"><B>J Ta </B><B>ed-search-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="55"><B>K Ta </B><B>ed-search-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="56"><B>N Ta </B><B>vi-repeat-search-prev</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="57"><B>O Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="58"><B>P Ta </B><B>vi-paste-prev</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="59"><B>R Ta </B><B>vi-replace-mode</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="60"><B>S Ta </B><B>vi-substitute-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="61"><B>T Ta </B><B>vi-to-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="62"><B>U Ta </B><B>vi-undo-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="63"><B>W Ta </B><B>vi-next-big-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="64"><B>X Ta </B><B>ed-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="65"><B>Y Ta </B><B>vi-yank-end</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="66"><B>[ Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="67"><B>^ Ta </B><B>ed-move-to-beg</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="68"><B>_ Ta </B><B>vi-history-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="69"><B>a Ta </B><B>vi-add</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="70"><B>b Ta </B><B>vi-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="71"><B>c Ta </B><B>vi-change-meta</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="72"><B>d Ta </B><B>vi-delete-meta</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="73"><B>e Ta </B><B>vi-end-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="74"><B>f Ta </B><B>vi-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="75"><B>h Ta </B><B>ed-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="76"><B>i Ta </B><B>vi-insert</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="77"><B>j Ta </B><B>ed-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="78"><B>k Ta </B><B>ed-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="79"><B>l Ta </B><B>ed-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="80"><B>n Ta </B><B>vi-repeat-search-next</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="81"><B>p Ta </B><B>vi-paste-next</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="82"><B>r Ta </B><B>vi-replace-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="83"><B>s Ta </B><B>vi-substitute-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="84"><B>t Ta </B><B>vi-to-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="85"><B>u Ta </B><B>vi-undo</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="86"><B>v Ta </B><B>vi-histedit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="87"><B>w Ta </B><B>vi-next-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="88"><B>x Ta </B><B>ed-delete-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="89"><B>y Ta </B><B>vi-yank</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="90"><B>| Ta </B><B>vi-to-column</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="91"><B>~ Ta </B><B>vi-change-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="92"><B>Ctrl-?, DEL Ta </B><B>ed-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="93"><B>Meta-O Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="94"><B>Meta-[ Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
|
|
In emacs mode, input characters are bound to the following editor
|
|
commands by default:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="95"><B>0 to 9 Ta </B><B>ed-digit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="96"><B>Ctrl-@, NUL Ta </B><B>em-set-mark</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="97"><B>Ctrl-A Ta </B><B>ed-move-to-beg</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="98"><B>Ctrl-B Ta </B><B>ed-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="99"><B>Ctrl-C, INT Ta </B><B>ed-tty-sigint</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="100"><B>Ctrl-D, EOF Ta </B><B>em-delete-or-list</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="101"><B>Ctrl-E Ta </B><B>ed-move-to-end</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="102"><B>Ctrl-F Ta </B><B>ed-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="103"><B>Ctrl-H, BS Ta </B><B>em-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="104"><B>Ctrl-J, LF Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="105"><B>Ctrl-K Ta </B><B>ed-kill-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="106"><B>Ctrl-L, FF Ta </B><B>ed-clear-screen</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="107"><B>Ctrl-M, CR Ta </B><B>ed-newline</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="108"><B>Ctrl-N Ta </B><B>ed-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="109"><B>Ctrl-O Ta </B><B>ed-tty-flush-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="110"><B>Ctrl-P Ta </B><B>ed-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="111"><B>Ctrl-Q Ta </B><B>ed-tty-start-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="112"><B>Ctrl-R Ta </B><B>ed-redisplay</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="113"><B>Ctrl-S Ta </B><B>ed-tty-stop-output</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="114"><B>Ctrl-T Ta </B><B>ed-transpose-chars</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="115"><B>Ctrl-U Ta </B><B>ed-kill-line</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="116"><B>Ctrl-V Ta </B><B>ed-quoted-insert</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="117"><B>Ctrl-W Ta </B><B>em-kill-region</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="118"><B>Ctrl-X Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="119"><B>Ctrl-Y Ta </B><B>em-yank</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="120"><B>Ctrl-Z, TSTP Ta </B><B>ed-tty-sigtstp</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="121"><B>Ctrl-[, ESC Ta </B><B>em-meta-next</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="122"><B>Ctrl-\, QUIT Ta </B><B>ed-tty-sigquit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="123"><B>Ctrl-] Ta </B><B>ed-tty-dsusp</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="124"><B>Ctrl-?, DEL Ta </B><B>em-delete-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="125"><B>Ctrl-Meta-H Ta </B><B>ed-delete-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="126"><B>Ctrl-Meta-L Ta </B><B>ed-clear-screen</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="127"><B>Ctrl-Meta-_ Ta </B><B>em-copy-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="128"><B>Meta-0 to 9 Ta </B><B>ed-argument-digit</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="129"><B>Meta-B Ta </B><B>ed-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="130"><B>Meta-C Ta </B><B>em-capitol-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="131"><B>Meta-D Ta </B><B>em-delete-next-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="132"><B>Meta-F Ta </B><B>em-next-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="133"><B>Meta-L Ta </B><B>em-lower-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="134"><B>Meta-N Ta </B><B>ed-search-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="135"><B>Meta-O Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="136"><B>Meta-P Ta </B><B>ed-search-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="137"><B>Meta-U Ta </B><B>em-upper-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="138"><B>Meta-W Ta </B><B>em-copy-region</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="139"><B>Meta-X Ta </B><B>ed-command</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="140"><B>Meta-[ Ta </B><B>ed-sequence-lead-in</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="141"><B>Meta-b Ta </B><B>ed-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="142"><B>Meta-c Ta </B><B>em-capitol-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="143"><B>Meta-d Ta </B><B>em-delete-next-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="144"><B>Meta-f Ta </B><B>em-next-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="145"><B>Meta-l Ta </B><B>em-lower-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="146"><B>Meta-n Ta </B><B>ed-search-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="147"><B>Meta-p Ta </B><B>ed-search-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="148"><B>Meta-u Ta </B><B>em-upper-case</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="149"><B>Meta-w Ta </B><B>em-copy-region</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="150"><B>Meta-x Ta </B><B>ed-command</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="151"><B>Ctrl-Meta-? Ta </B><B>ed-delete-prev-word</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
|
|
The remaining
|
|
<A HREF="/cgi-bin/man/man2html?7+ascii">ascii</A>(7)
|
|
|
|
|
|
characters in the range 0x20 to 0x7e are bound to
|
|
<B>ed-insert</B>
|
|
|
|
|
|
<P>
|
|
|
|
If standard output is not connected to a terminal device
|
|
or
|
|
el_set3
|
|
|
|
|
|
was used to set
|
|
<B>EL_EDITMODE</B>
|
|
|
|
to 0, all input character bindings are disabled and all characters
|
|
typed are appended to the edit buffer.
|
|
In that case, the edit buffer is returned to the program after a
|
|
newline or carriage return character is typed, or after the first
|
|
character typed if
|
|
el_set3
|
|
|
|
|
|
was used to set
|
|
<B>EL_UNBUFFERED</B>
|
|
|
|
to non-zero.
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Editor commands</H3>
|
|
|
|
Most editor commands accept an optional argument.
|
|
The argument is entered by prefixing the editor command with one
|
|
or more of the editor commands
|
|
<B>ed-argument-digit</B>
|
|
|
|
|
|
<B>ed-digit</B>
|
|
|
|
|
|
<B>em-universal-argument</B>
|
|
|
|
|
|
or
|
|
<B>vi-zero</B>
|
|
|
|
|
|
When an argument is not provided, it defaults to 1.
|
|
For most editor commands, the effect of an argument is to repeatedly
|
|
execute the command that number of times.
|
|
<P>
|
|
|
|
When talking about a character string from a left character to a
|
|
right character, the left character is included in the string, while
|
|
the right character is not included.
|
|
<P>
|
|
|
|
If an editor command causes an error, the input character is discarded,
|
|
no action occurs, and the terminal bell is rung.
|
|
In case of a non-fatal error, the terminal bell is also rung,
|
|
but the editor command takes effect anyway.
|
|
<P>
|
|
|
|
In the following list, the default key bindings are listed after
|
|
each editor command.
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="152"><B>ed-argument-digit (vi command: 1 to 9; emacs: Meta-0 to Meta-9)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If in argument input mode, append the input digit to the argument
|
|
being read.
|
|
Otherwise, switch to argument input mode and use the input digit
|
|
as the most significant digit of the argument.
|
|
It is an error if the input character is not a digit or if the
|
|
existing argument is already greater than a million.
|
|
<DT id="153"><B>ed-clear-screen (vi command: Ctrl-L; emacs: Ctrl-L, Ctrl-Meta-L)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Clear the screen and display the edit buffer at the top.
|
|
Ignore any argument.
|
|
<DT id="154"><B>ed-command (vi command: So </B>: Sc ; emacs: Meta-X, Meta-x
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
Read a line from the terminal bypassing the normal line editing
|
|
functionality and execute that line as an
|
|
editrc(5edit)
|
|
|
|
|
|
builtin command.
|
|
If in vi command mode, also switch back to vi insert mode.
|
|
Ignore any argument.
|
|
<DT id="155"><B>ed-delete-next-char (vi command: x)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the character at the cursor position.
|
|
With an argument, delete that number of characters.
|
|
In emacs mode, it is an error if the cursor is at the end of the
|
|
edit buffer.
|
|
In vi mode, the last character in the edit buffer is deleted in
|
|
that case, and it is an error if the buffer is empty.
|
|
<DT id="156"><B>ed-delete-prev-char (vi command: X, Ctrl-H, BS, Ctrl-?, DEL)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the character to the left of the cursor position.
|
|
With an argument, delete that number of characters.
|
|
It is an error if the cursor is at the beginning of the edit buffer.
|
|
<DT id="157"><B>ed-delete-prev-word (vi: Ctrl-W; emacs: Ctrl-Meta-H, Ctrl-Meta-?)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move to the left to the closest beginning of a word, delete the
|
|
string from that position to the cursor, and save it to the cut
|
|
buffer.
|
|
With an argument, delete that number of words.
|
|
It is an error if the cursor is at the beginning of the edit buffer.
|
|
<DT id="158"><B>ed-digit (emacs: 0 to 9)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If in argument input mode, append the input digit to the argument
|
|
being read.
|
|
Otherwise, call
|
|
<B>ed-insert</B>
|
|
|
|
|
|
It is an error if the input character is not a digit or if the
|
|
existing argument is already greater than a million.
|
|
<DT id="159"><B>ed-end-of-file (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Discard the edit buffer and indicate end of file to the program.
|
|
Ignore any argument.
|
|
<DT id="160"><B>ed-ignore (various)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Discard the input character and do nothing.
|
|
<DT id="161"><B>ed-insert (vi input: almost all; emacs: printable characters)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
In insert mode, insert the input character left of the cursor
|
|
position.
|
|
In replace mode, overwrite the character at the cursor and move the
|
|
cursor to the right by one character position.
|
|
Accept an argument to do this repeatedly.
|
|
It is an error if the input character is the NUL character (Ctrl-@).
|
|
Failure to enlarge the edit buffer also results in an error.
|
|
<DT id="162"><B>ed-kill-line (vi command: D, Ctrl-K; emacs: Ctrl-K, Ctrl-U)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor position to the end of the line
|
|
and save it to the cut buffer.
|
|
Ignore any argument.
|
|
<DT id="163"><B>ed-move-to-beg (vi command: ^, Ctrl-A; emacs: Ctrl-A)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
In vi mode, move the cursor to the first non-space character in the
|
|
edit buffer.
|
|
In emacs mode, move the cursor to the beginning of the edit buffer.
|
|
Ignore any argument.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
<DT id="164"><B>ed-move-to-end (vi command: $, Ctrl-E; emacs: Ctrl-E)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the end of the edit buffer.
|
|
Ignore any argument.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
<DT id="165"><B>ed-newline (all modes: Ctrl-J, LF, Ctrl-M, CR)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Append a newline character to the edit buffer and return the edit
|
|
buffer to the program.
|
|
Ignore any argument.
|
|
<DT id="166"><B>ed-next-char (vi command: Space, l; emacs: Ctrl-F)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor one character position to the right.
|
|
With an argument, move by that number of characters.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer.
|
|
<DT id="167"><B>ed-next-history (vi command: j, +, Ctrl-N; emacs: Ctrl-N)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the next history line.
|
|
That line is older than the current line.
|
|
With an argument, go forward by that number of history lines.
|
|
It is a non-fatal error to advance by more lines than are available.
|
|
<DT id="168"><B>ed-next-line (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor down one line.
|
|
With an argument, move down by that number of lines.
|
|
It is an error if the edit buffer does not contain enough newline
|
|
characters to the right of the cursor position.
|
|
<DT id="169"><B>ed-prev-char (vi command: h; emacs: Ctrl-B)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor one character position to the left.
|
|
With an argument, move by that number of characters.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the beginning of the
|
|
edit buffer.
|
|
<DT id="170"><B>ed-prev-history (vi command: k, -, Ctrl-P; emacs: Ctrl-P)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the previous history line.
|
|
That line is newer than the current line.
|
|
With an argument, go back by that number of lines.
|
|
It is a non-fatal error to back up by more lines than are available.
|
|
<DT id="171"><B>ed-prev-line (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor up one line.
|
|
With an argument, move up by that number of lines.
|
|
It is an error if the edit buffer does not contain enough newline
|
|
characters to the left of the cursor position.
|
|
<DT id="172"><B>ed-prev-word (emacs: Meta-B, Meta-b)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the left to the closest beginning of a word.
|
|
With an argument, repeat that number of times.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the beginning of the
|
|
edit buffer.
|
|
<DT id="173"><B>ed-quoted-insert (vi insert, emacs: Ctrl-V)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Read one character from the terminal bypassing the normal line
|
|
editing functionality and call
|
|
<B>ed-insert</B>
|
|
|
|
on it.
|
|
If trying to read the character returns end of file or an error,
|
|
call
|
|
<B>ed-end-of-file</B>
|
|
|
|
instead.
|
|
<DT id="174"><B>ed-redisplay (vi command, emacs: Ctrl-R)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Redisplay everything.
|
|
Ignore any argument.
|
|
<DT id="175"><B>ed-search-next-history (vi command: J; emacs: Meta-N, Meta-n)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the next matching history entry.
|
|
<DT id="176"><B>ed-search-prev-history (vi command: K; emacs: Meta-P, Meta-p)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the previous matching history entry.
|
|
<DT id="177"><B>ed-sequence-lead-in (vi cmd: O, [; emacs: Ctrl-X;<BR> both: Meta-O, Meta-[)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Call a macro.
|
|
See the section about
|
|
Sx Macros
|
|
|
|
below for details.
|
|
<DT id="178"><B>ed-start-over (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Discard the contents of the edit buffer and start from scratch.
|
|
Ignore any argument.
|
|
<DT id="179"><B>ed-transpose-chars (emacs: Ctrl-T)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Exchange the character at the cursor position with the one to the
|
|
left of it and move the cursor to the character to the right of the
|
|
two exchanged characters.
|
|
Ignore any argument.
|
|
It is an error if the cursor is at the beginning of the edit buffer
|
|
or if the edit buffer contains less than two characters.
|
|
<DT id="180"><B>ed-unassigned (all characters not listed)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
This editor command always results in an error.
|
|
<DT id="181"><B>em-capitol-case (emacs: Meta-C, Meta-c)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Capitalize the string from the cursor to the end of the current
|
|
word.
|
|
That is, if it contains at least one alphabetic character, convert
|
|
the first alphabetic character to upper case, and convert all
|
|
characters to the right of it to lower case.
|
|
In any case, move the cursor to the next character after the end
|
|
of the current word.
|
|
<DT id="182"><B>em-copy-prev-word (emacs: Ctrl-Meta-_)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Copy the string from the beginning of the current word to the cursor
|
|
and insert it to the left of the cursor.
|
|
Move the cursor to the character after the inserted string.
|
|
It is an error if the cursor is at the beginning of the edit buffer.
|
|
<DT id="183"><B>em-copy-region (emacs: Meta-W, Meta-w)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Copy the string from the cursor to the mark to the cut buffer.
|
|
It is an error if the mark is not set.
|
|
<DT id="184"><B>em-delete-next-word (emacs: Meta-D, Meta-d)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor to the end of the current word
|
|
and save it to the cut buffer.
|
|
It is an error if the cursor is at the end of the edit buffer.
|
|
<DT id="185"><B>em-delete-or-list (emacs: Ctrl-D, EOF)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If the cursor is not at the end of the line, delete the character
|
|
at the cursor.
|
|
If the edit buffer is empty, indicate end of file to the program.
|
|
It is an error if the cursor is at the end of the edit buffer and
|
|
the edit buffer is not empty.
|
|
<DT id="186"><B>em-delete-prev-char (emacs: Ctrl-H, BS, Ctrl-?, DEL)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the character to the left of the cursor.
|
|
It is an error if the cursor is at the beginning of the edit buffer.
|
|
<DT id="187"><B>em-exchange-mark (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Exchange the cursor and the mark.
|
|
<DT id="188"><B>em-gosmacs-transpose (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Exchange the two characters to the left of the cursor.
|
|
It is an error if the cursor is on the first or second character
|
|
of the edit buffer.
|
|
<DT id="189"><B>em-inc-search-next (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Emacs incremental next search.
|
|
<DT id="190"><B>em-inc-search-prev (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Emacs incremental reverse search.
|
|
<DT id="191"><B>em-kill-line (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the entire contents of the edit buffer and save it to the
|
|
cut buffer.
|
|
<DT id="192"><B>em-kill-region (emacs: Ctrl-W)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor to the mark and save it to the
|
|
cut buffer.
|
|
It is an error if the mark is not set.
|
|
<DT id="193"><B>em-lower-case (emacs: Meta-L, Meta-l)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Convert the characters from the cursor to the end of the current
|
|
word to lower case.
|
|
<DT id="194"><B>em-meta-next (vi command, emacs: Ctrl-[, ESC)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Set the bit 0x80 on the next character typed.
|
|
Unless the resulting code point is printable, holding down the
|
|
`Meta-'
|
|
|
|
key while typing that character is a simpler way to achieve the
|
|
same effect.
|
|
<DT id="195"><B>em-next-word (Meta-F, Meta-f)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the end of the current word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer.
|
|
<DT id="196"><B>em-set-mark (emacs: Ctrl-Q, NUL)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Set the mark at the current cursor position.
|
|
<DT id="197"><B>em-toggle-overwrite (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Switch from insert to overwrite mode or vice versa.
|
|
<DT id="198"><B>em-universal-argument (not bound by default)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If in argument input mode, multiply the argument by 4.
|
|
Otherwise, switch to argument input mode and set the argument to 4.
|
|
It is an error if the existing argument is already greater than a
|
|
million.
|
|
<DT id="199"><B>em-upper-case (emacs: Meta-U, Meta-u)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Convert the characters from the cursor to the end of the current
|
|
word to upper case.
|
|
<DT id="200"><B>em-yank (emacs: Ctrl-Y)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Paste the cut buffer to the left of the cursor.
|
|
<DT id="201"><B>vi-add (vi command: a)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Switch to vi insert mode.
|
|
Unless the cursor is already at the end of the edit buffer, move
|
|
it one character position to the right.
|
|
<DT id="202"><B>vi-add-at-eol (vi command: A)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Switch to vi insert mode and move the cursor to the end of the edit
|
|
buffer.
|
|
<DT id="203"><B>vi-alias (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
If an alias function was defined by calling the
|
|
el_set3
|
|
|
|
|
|
or
|
|
el_wset3
|
|
|
|
|
|
function with the argument
|
|
<B>EL_ALIAS_TEXT</B>
|
|
|
|
|
|
read one character from the terminal bypassing the normal line
|
|
editing functionality, call the alias function passing the argument that was specified with
|
|
<B>EL_ALIAS_TEXT</B>
|
|
|
|
as the first argument and the character read, with an underscore
|
|
prepended, as the second argument, and pass the string returned
|
|
from the alias function to
|
|
el_wpush3.
|
|
|
|
|
|
It is an error if no alias function is defined or if trying to read
|
|
the character results in end of file or an error.
|
|
<DT id="204"><B>vi-change-case (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
Change the case of the character at the cursor and move the cursor
|
|
one character position to the right.
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer.
|
|
<DT id="205"><B>vi-change-meta (vi command: c)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor to the position specified by the
|
|
following movement command and save a copy of it to the cut buffer.
|
|
When given twice in a row, instead delete the whole contents of the
|
|
edit buffer and save a copy of it to the cut buffer.
|
|
In either case, switch to vi insert mode after that.
|
|
<DT id="206"><B>vi-change-to-eol (vi command: C)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor position to the end of the line
|
|
and save it to the cut buffer, then switch to vi insert mode.
|
|
<DT id="207"><B>vi-command-mode (vi insert: Ctrl-[, ESC)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Discard pending actions and arguments and switch to vi command mode.
|
|
Unless the cursor is already at the beginning of the edit buffer,
|
|
move it to the left by one character position.
|
|
<DT id="208"><B>vi-comment-out (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
Insert a
|
|
`#'
|
|
|
|
character at the beginning of the edit buffer and return the edit
|
|
buffer to the program.
|
|
<DT id="209"><B>vi-delete-meta (vi command: d)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the cursor to the position specified by the
|
|
following movement command and save a copy of it to the cut buffer.
|
|
When given twice in a row, instead delete the whole contents of the
|
|
edit buffer and save a copy of it to the cut buffer.
|
|
<DT id="210"><B>vi-delete-prev-char (vi insert: Ctrl-H, BS, Ctrl-?, DEL)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the character to the left of the cursor.
|
|
It is an error if the cursor is already at the beginning of the
|
|
edit buffer.
|
|
<DT id="211"><B>vi-end-big-word (vi command: E)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the end of the current space delimited word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer.
|
|
<DT id="212"><B>vi-end-word (vi command: e)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the end of the current word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer.
|
|
<DT id="213"><B>vi-history-word (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
Insert the first word from the most recent history entry after the
|
|
cursor, move the cursor after to the character after the inserted
|
|
word, and switch to vi insert mode.
|
|
It is an error if there is no history entry or the most recent
|
|
history entry is empty.
|
|
<DT id="214"><B>vi-insert (vi command: i)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Enter insert mode.
|
|
<DT id="215"><B>vi-insert-at-bol (vi command: I)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the beginning of the edit buffer and switch to
|
|
vi insert mode.
|
|
<DT id="216"><B>vi-kill-line-prev (vi: Ctrl-U)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the string from the beginning of the edit buffer to the
|
|
cursor and save it to the cut buffer.
|
|
<DT id="217"><B>vi-list-or-eof (vi insert: Ctrl-D, EOF)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If the edit buffer is empty, indicate end of file to the program.
|
|
It is an error if the edit buffer is not empty.
|
|
<DT id="218"><B>vi-match (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
Consider opening and closing parentheses, braces, and brackets as
|
|
delimiters.
|
|
If the cursor is not at a delimiter, move it to the right until it
|
|
gets to one, then move it to the matching delimiter.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if there is no delimiter at the cursor or in the
|
|
string to the right of the cursor, or if the first such delimiter
|
|
has no matching delimiter.
|
|
<DT id="219"><B>vi-next-big-word (vi command: W)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the right to the beginning of the next space
|
|
delimited word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer or on its last character.
|
|
<DT id="220"><B>vi-next-char (vi command: f)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Read one character from the terminal bypassing the normal line
|
|
editing functionality and move the cursor to the right to the next
|
|
instance of that character in the edit buffer.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
If trying to read the character results in end of file or an error,
|
|
call
|
|
<B>ed-end-of-file</B>
|
|
|
|
instead.
|
|
It is an error if the character is not found searching to the right
|
|
in the edit buffer.
|
|
<DT id="221"><B>vi-next-word (vi command: w)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the right to the beginning of the next word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the end of the edit
|
|
buffer or on its last character.
|
|
<DT id="222"><B>vi-paste-next (vi command: p)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Insert a copy of the cut buffer to the right of the cursor.
|
|
It is an error if the cut buffer is empty.
|
|
<DT id="223"><B>vi-paste-prev (vi command: P)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Insert a copy of the cut buffer to the left of the cursor.
|
|
It is an error if the cut buffer is empty.
|
|
<DT id="224"><B>vi-prev-big-word (vi command: B)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the left to the next beginning of a space delimited
|
|
word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the beginning of the
|
|
edit buffer.
|
|
<DT id="225"><B>vi-prev-char (vi command: F)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Read one character from the terminal bypassing the normal line
|
|
editing functionality and move the cursor to the left to the next
|
|
instance of that character in the edit buffer.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
If trying to read the character results in end of file or an error,
|
|
call
|
|
<B>ed-end-of-file</B>
|
|
|
|
instead.
|
|
It is an error if the character is not found searching to the left
|
|
in the edit buffer.
|
|
<DT id="226"><B>vi-prev-word (vi command: b)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the left to the next beginning of a word.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
It is an error if the cursor is already at the beginning of the
|
|
edit buffer.
|
|
<DT id="227"><B>vi-redo (vi command: `.'
|
|
|
|
)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Redo the last non-motion command.
|
|
<DT id="228"><B>vi-repeat-next-char (vi command: `;'
|
|
|
|
)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Repeat the most recent character search in the same search direction.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
<DT id="229"><B>vi-repeat-prev-char (vi command: `,'
|
|
|
|
)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Repeat the most recent character search in the opposite search
|
|
direction.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
<DT id="230"><B>vi-repeat-search-next (vi command: n)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Repeat the most recent history search in the same search direction.
|
|
<DT id="231"><B>vi-repeat-search-prev (vi command: N)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Repeat the most recent history search in the opposite search
|
|
direction.
|
|
<DT id="232"><B>vi-replace-char (vi command: r)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Switch to vi replace mode, and automatically switch back to vi
|
|
command mode after the next character typed.
|
|
See
|
|
<B>ed-insert</B>
|
|
|
|
for a description of replace mode.
|
|
It is an error if the cursor is at the end of the edit buffer.
|
|
<DT id="233"><B>vi-replace-mode (vi command: R)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Switch to vi replace mode.
|
|
This is a variant of vi insert mode; see
|
|
<B>ed-insert</B>
|
|
|
|
for the difference.
|
|
<DT id="234"><B>vi-search-next (vi command: ?)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the next matching history entry.
|
|
<DT id="235"><B>vi-search-prev (vi command:)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
|
|
Replace the edit buffer with the previous matching history entry.
|
|
<DT id="236"><B>vi-substitute-char (vi command: s)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the character at the cursor and switch to vi insert mode.
|
|
<DT id="237"><B>vi-substitute-line (vi command: S)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Delete the entire contents of the edit buffer, save a copy of it
|
|
in the cut buffer, and enter vi insert mode.
|
|
<DT id="238"><B>vi-to-column (vi command: |)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Move the cursor to the column specified as the argument.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
<DT id="239"><B>vi-to-history-line (vi command: G)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Replace the edit buffer with the specified history entry.
|
|
<DT id="240"><B>vi-to-next-char (vi command: t)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Read one character from the terminal bypassing the normal line
|
|
editing functionality and move the cursor to the right to the
|
|
character before the next instance of that character in the edit
|
|
buffer.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
If trying to read the character results in end of file or an error,
|
|
call
|
|
<B>ed-end-of-file</B>
|
|
|
|
instead.
|
|
It is an error if the character is not found searching to the right
|
|
in the edit buffer.
|
|
<DT id="241"><B>vi-to-prev-char (vi command: T)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Read one character from the terminal bypassing the normal line
|
|
editing functionality and move the cursor to the left to the character
|
|
after the next instance of that character in the edit buffer.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
If trying to read the character results in end of file or an error,
|
|
call
|
|
<B>ed-end-of-file</B>
|
|
|
|
instead.
|
|
It is an error if the character is not found searching to the left
|
|
in the edit buffer.
|
|
<DT id="242"><B>vi-undo (vi command: u)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Undo the last change.
|
|
<DT id="243"><B>vi-undo-line (vi command: U)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Undo all changes to the edit buffer.
|
|
<DT id="244"><B>vi-yank (vi command: y)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Copy the string from the cursor to the position specified by the
|
|
following movement command to the cut buffer.
|
|
When given twice in a row, instead copy the whole contents of the
|
|
edit buffer to the cut buffer.
|
|
<DT id="245"><B>vi-yank-end (vi command: Y)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
Copy the string from the cursor to the end of the edit buffer to
|
|
the cut buffer.
|
|
<DT id="246"><B>vi-zero (vi command: 0)
|
|
|
|
</B>
|
|
|
|
|
|
<DD>
|
|
If in argument input mode, multiply the argument by ten.
|
|
Otherwise, move the cursor to the beginning of the edit buffer.
|
|
Can be used as a movement command after
|
|
<B>vi_change_meta</B>
|
|
|
|
|
|
<B>vi_delete_meta</B>
|
|
|
|
|
|
or
|
|
<B>vi_yank</B>
|
|
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Macros</H3>
|
|
|
|
If an input character is bound to the editor command
|
|
<B>ed-sequence-lead-in</B>
|
|
|
|
|
|
<B></B>
|
|
|
|
|
|
attempts to call a macro.
|
|
If the input character by itself forms the name of a macro, that
|
|
macro is executed.
|
|
Otherwise, additional input characters are read until the string
|
|
read forms the name of a macro, in which case that macro is executed,
|
|
or until the string read matches the beginning of none of the existing
|
|
macro names, in which case the string including the final, mismatching
|
|
character is discarded and the terminal bell is rung.
|
|
<P>
|
|
|
|
There are two kinds of macros.
|
|
Command macros execute a single editor command.
|
|
Keyboard macros return a string of characters that is appended
|
|
as a new line to the
|
|
Sx Input Queue .
|
|
|
|
<P>
|
|
|
|
The following command macros are defined by default in vi command
|
|
mode and in emacs mode:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="247"><B>Esc [ A, Esc O A Ta </B><B>ed-prev-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="248"><B>Esc [ B, Esc O B Ta </B><B>ed-next-history</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="249"><B>Esc [ C, Esc O C Ta </B><B>ed-next-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="250"><B>Esc [ D, Esc O D Ta </B><B>ed-prev-char</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="251"><B>Esc [ F, Esc O F Ta </B><B>ed-move-to-end</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
<DT id="252"><B>Esc [ H, Esc O H Ta </B><B>ed-move-to-beg</B>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
|
|
In vi command mode, they are also defined by default without the
|
|
initial escape character.
|
|
<P>
|
|
|
|
In addition, the
|
|
<B></B>
|
|
|
|
|
|
library tries to bind the strings generated by the arrow keys
|
|
as reported by the
|
|
<A HREF="/cgi-bin/man/man2html?5+terminfo">terminfo</A>(5)
|
|
|
|
|
|
database to these editor commands, unless that would clobber
|
|
user settings.
|
|
<P>
|
|
|
|
In emacs mode, the two-character string
|
|
``Ctrl-X Ctrl-X''
|
|
|
|
is bound to the
|
|
<B>em-exchange-mark</B>
|
|
|
|
editor command.
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Input Queue</H3>
|
|
|
|
The
|
|
<B></B>
|
|
|
|
|
|
library maintains an input queue operated in FIFO mode.
|
|
Whenever it needs an input character, it takes the first character
|
|
from the first line of the input queue.
|
|
When the queue is empty, it reads from the terminal.
|
|
<P>
|
|
|
|
A line can be appended to the end of the input queue in several ways:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="253"><B>By calling one of the keyboard</B>
|
|
<DD>
|
|
Sx Macros .
|
|
|
|
<DT id="254"><B>By calling the editor command</B>
|
|
<DD>
|
|
<B>vi-redo</B>
|
|
|
|
|
|
<DT id="255"><B>By calling the editor command</B>
|
|
<DD>
|
|
<B>vi-alias</B>
|
|
|
|
|
|
<DT id="256"><B>By pressing a key in emacs incremental search mode that doesn't</B>
|
|
<DD>
|
|
have a special meaning in that mode but returns to normal emacs
|
|
mode.
|
|
<DT id="257"><B>If an application program directly calls the functions</B>
|
|
<DD>
|
|
el_push3
|
|
|
|
|
|
or
|
|
el_wpush3,
|
|
|
|
|
|
it can provide additional, program-specific ways
|
|
of appending to the input queue.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+mg">mg</A>(1),
|
|
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+vi">vi</A>(1),
|
|
|
|
|
|
editline(3edit),
|
|
|
|
|
|
el_wgets3,
|
|
|
|
|
|
el_wpush3,
|
|
|
|
|
|
el_wset3,
|
|
|
|
|
|
editrc(5edit)
|
|
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>HISTORY</H2>
|
|
|
|
This manual page first appeared in
|
|
Ox 6.0
|
|
|
|
and
|
|
Nx 8 .
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
An -nosplit
|
|
|
|
This manual page was written by
|
|
An Ingo Schwarze Aq Mt <A HREF="mailto:schwarze@openbsd.org">schwarze@openbsd.org</A> .
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="258"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="259"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="260"><A HREF="#lbAD">Input character bindings</A><DD>
|
|
<DT id="261"><A HREF="#lbAE">Editor commands</A><DD>
|
|
<DT id="262"><A HREF="#lbAF">Macros</A><DD>
|
|
<DT id="263"><A HREF="#lbAG">Input Queue</A><DD>
|
|
</DL>
|
|
<DT id="264"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="265"><A HREF="#lbAI">HISTORY</A><DD>
|
|
<DT id="266"><A HREF="#lbAJ">AUTHORS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:08 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|