|
|
coherent
elvis Command elvis
Clone of UNIX-standard screen editor
eellvviiss [ _f_l_a_g_s ] [ +_c_m_d ] [ _f_i_l_e_1 ... _f_i_l_e_2_7 ]
elvis is a clone of vi and ex, the standard UNIX screen editors.
Unlike MicroEMACS, the COHERENT system's other screen editor, el-
vis is a modal editor whose command structure resembles the ed
line editor. Modal means that a keystroke assumes a different
meaning, depending upon the mode that the editor is in. elvis
uses three modes: visual command mode, colon command mode, and
input mode. The following sections summarize the commands as-
sociated with each mode.
***** Visual Command Mode *****
Visual-command mode closely resembles text-input mode. One quick
way to tell the modes apart is to press the <esc> key. If elvis
beeps, then you are in visual-command mode. If it does not beep,
then you were in input mode, but pressing <esc> switched you to
visual-command mode.
Most visual-mode commands are one keystroke long. The commands
are in two groups: movement commands and edit commands. The
former group moves the cursor through the file being edited, and
the latter group alters text.
The following sections summarize the command set for elvis's
visual command mode.
***** Visual-Mode Movement Commands *****
The following summarizes the visual mode's movement commands.
count indicates that the command can be optionally prefaced by an
argument that tells elvis how often to execute the command. move
indicates that the command can be followed by a movement command,
after which the command is executed on the text that lies between
the point where the command was first typed and the point to
which the cursor was moved. Typing the command a second time ex-
ecutes the command for the entire line upon which the cursor is
positioned. key means that the command must be followed by an
argument. The following describes
<ccttrrll-BB> Move up by one screenful.
[_c_o_u_n_t] <ccttrrll-DD>
Scroll down count lines (default, one-half screen-
ful).
[_c_o_u_n_t] <ccttrrll-EE>
Scroll up count lines.
<ccttrrll-FF> Move down by one screenful.
COHERENT Lexicon Page 1
elvis Command elvis
<ccttrrll-GG> Show file status and the current line line.
[_c_o_u_n_t] <ccttrrll-HH>
Move one character to the left.
[count] <ccttrrll-JJ>
Move down count lines.
<ccttrrll-LL> Redraw the screen.
[_c_o_u_n_t] <ccttrrll-MM>
Move to the beginning of the next line.
[_c_o_u_n_t] <ccttrrll-NN>
Move down count lines (default, one).
[_c_o_u_n_t] <ccttrrll-PP>
Move up count lines (default, one).
<ccttrrll-RR> Redraw the screen.
[_c_o_u_n_t] <ccttrrll-UU>
Scroll up count lines (default, one-half screenful).
[_c_o_u_n_t] <ccttrrll-YY>
Scroll down count lines.
<ccttrrll-]> If the cursor is on a tag name, go to that tag.
<ccttrrll-^> Switch to the previous file.
[_c_o_u_n_t] <ssppaaccee>
Move right count spaces (default, one).
! [_m_o_v_e]
Run the selected text through an external filter
program.
`` _k_e_y Select which cut buffer to use next.
$ Move to the end of the current line.
% Move to the matching (){}[] character.
' _k_e_y Move to a marked line.
[count] (
Move backward count sentences (default, one).
[_c_o_u_n_t] )
Move forward count sentences (default, one).
* Go to the next error in the error list.
COHERENT Lexicon Page 2
elvis Command elvis
[_c_o_u_n_t] +
Move to the beginning of the next line.
[_c_o_u_n_t] ,
Repeat the previous ff or tt command, but move in the
opposite direction.
[_c_o_u_n_t] --
Move to the beginning of the preceding line.
[_c_o_u_n_t] .
Repeat the previous _e_d_i_t command.
/ _t_e_x_t Search forward for text, which can be a regular
expression.
00 If not part of a count, move to the first character
of this line.
: Switch to colon-command mode to execute one command.
[_c_o_u_n_t] ;
Repeat the previous ff or tt command.
? _t_e_x_t Search backwards for text, which can be a regular
expression.
@ _k_e_y Execute the contents of a cut-buffer as vi commands.
[_c_o_u_n_t] BB
Move backwards count words (default, one).
[_c_o_u_n_t] EE
Move forwards count words (default, one).
[count] FF _k_e_y
Move left to the _c_o_u_n_t'th occurrence of the given
character (default, first).
[_c_o_u_n_t] GG
Move to to the _c_o_u_n_t'th line in the file (default,
last).
[_c_o_u_n_t] HH
Move to the top of the screen.
KK Look up a keyword.
[_c_o_u_n_t] LL
Move to the bottom of the screen.
MM Move to the middle of the screen.
NN Repeat the last search, but in the opposite direc-
tion.
COHERENT Lexicon Page 3
elvis Command elvis
PP Paste text before the cursor.
QQ Shift to colon-command mode.
[_c_o_u_n_t] TT _k_e_y
Move left _a_l_m_o_s_t to the given character.
UU Undo all recent changes to the current line.
[_c_o_u_n_t] UU
Move forward count words (default, one).
[_c_o_u_n_t] YY
Copy (or ``yank'') count lines into a cut buffer
(default, one).
ZZ ZZ Save the file and exit.
[ [ Move back one section.
] ] Move forward one section.
^ Move to the beginning of the current line, but after
indent.
` _k_e_y Move to the key character.
[_c_o_u_n_t] bb
Move back count words.
[_c_o_u_n_t] ee
Move forward to the end of the _c_o_u_n_t'th word.
[_c_o_u_n_t] ff _k_e_y
Move rightward to the _c_o_u_n_t'th occurrence of the
given character.
[_c_o_u_n_t] hh
Move left count characters (default, one).
[_c_o_u_n_t] jj
Move down count characters (default, one).
[_c_o_u_n_t] kk
Move up count characters (default, one).
[_c_o_u_n_t] ll
Move right count characters (default, one).
mm _k_e_y Mark a line or character.
nn Repeat the previous search.
COHERENT Lexicon Page 4
elvis Command elvis
pp Paste text after the cursor.
[_c_o_u_n_t] tt _k_e_y
Move rightward _a_l_m_o_s_t to the _c_o_u_n_t'th occurrence of
the given character (default, one).
uu Undo the previous edit command.
[_c_o_u_n_t] ww
Move forward count words (default, one).
yy _m_o_v_e
Copy (or ``yank'') text into a cut buffer.
zz _k_e_y Scroll the screen, repositioning the current line as
follows: + indicates top of the screen, -- indicates
the bottom, . indicates the middle.
[_c_o_u_n_t] {
Move back count paragraphs (default, one).
[_c_o_u_n_t] |
Move to the _c_o_u_n_t'th column on the screen (leftmost,
one).
[_c_o_u_n_t] }
Move forward count paragraphs (default, one).
***** Visual-Mode Edit Commands ***** The following describes the
visual mode's editing commands.
[_c_o_u_n_t] #
Increment a number by count (default, one).
[_c_o_u_n_t] &
Repeat the previous :ss// command.
< _m_o_v_e
Shift the enclosed text left.
> _m_o_v_e
Shift the enclosed text right.
[_c_o_u_n_t] AA _i_n_p_u_t
Append input at end of the line.
CC _i_n_p_u_t
Change text from the cursor through the end of the line.
DD Delete text from the cursor through the end of the line.
[_c_o_u_n_t] II _i_n_p_u_t
Insert text at the beginning of the line (after inden-
tations).
COHERENT Lexicon Page 5
elvis Command elvis
[_c_o_u_n_t] JJ
Join lines the current with the following line.
[_c_o_u_n_t] OO _i_n_p_u_t
Open a new line above the current line.
RR _i_n_p_u_t
Overtype.
[_c_o_u_n_t] SS input
Change lines, like cccc.
[_c_o_u_n_t] XX
Delete count characters from the left of the cursor
(default, one).
[_c_o_u_n_t] aa _i_n_p_u_t
Insert text after the cursor.
cc _m_o_v_e
Change text.
dd _m_o_v_e
Delete text.
[_c_o_u_n_t] ii _i_n_p_u_t
Insert text at the cursor.
[_c_o_u_n_t] oo _i_n_p_u_t
Open a new line below the current line.
[_c_o_u_n_t] rr _k_e_y
Replace count characters with text you type (default, one).
[_c_o_u_n_t] ss _i_n_p_u_t
Replace count characters with text you type (default, one).
[_c_o_u_n_t] xx
Delete the character at which the cursor is positioned.
[_c_o_u_n_t] ~
Toggle a character between upper case and lower case.
***** Colon-Mode Commands ***** The following summarizes the set
of colon-mode commands. It is no accident that these commands
closely resemble those for the ed line editor: they come, in
fact, from ex, the editor upon which both vi (the UNIX visual
editor) and ed derive. For that reason, colon-command mode is
sometimes called ex mode.
line indicates whether the command can be executed on one or more
lines. line can be a regular expression. Some commands can be
used with an optional exclamation point; if done so, the editor
assumes you know what you are doing and suppresses the warnings
and prompts it would normally issue for these commands. Please
COHERENT Lexicon Page 6
elvis Command elvis
note, finally, that most commands can be invoked simply by typing
the first one or two letters of their names.
aabbbbrr [_w_o_r_d _f_u_l_l__f_o_r_m]
Define word as an abbreviation for full_form.
[_l_i_n_e] aappppeenndd
Insert text after the current line.
aarrggss [_f_i_l_e_1 ... _f_i_l_e_N]
With no arguments, print the files list on eellvviiss's
command line. With one or more arguments, change
the name of the current file.
cccc [_f_i_l_e_s]
Invoke the C compiler to compile files, and
redirects all error messages into file errlist.
After the compiler exits, scan the contents of er-
rlist for error messages; if one is found, jump to
the line and file indicated on the error line, and
display the error message on the status line.
ccdd [_d_i_r_e_c_t_o_r_y]
Switch the current working directory. With no argu-
ment, switch to the $HOME directory.
[_l_i_n_e][,_l_i_n_e] cchhaannggee [``_x]
Replace the range of lines with the contents of cut-
buffer x.
cchhddiirr [_d_i_r_e_c_t_o_r_y]
Same as the cd command.
[_l_i_n_e][,_l_i_n_e] ccooppyy _t_a_r_g_e_t_l_i_n_e
Copy the range of lines to after the targetline.
[_l_i_n_e][,_l_i_n_e] ddeelleettee [``_x]
Move the range of lines into cut buffer x.
ddiiggrraapphh[!] [_X_X [_Y]]
Set XX as a digraph for Y. With no arguments, dis-
play all currently defined digraphs. With one argu-
ment, undefine the argument as a digraph.
eeddiitt[!] [_f_i_l_e]
Edit a file not named on the elvis command line.
eerrrrlliisstt[!] [_e_r_r_l_i_s_t]
Find the next error message in file errlist, as
generated through elvis's cc or make commands.
ffiillee [_f_i_l_e]
With an argument, change the output file to file.
Without an argument, print information about the
current output file.
COHERENT Lexicon Page 7
elvis Command elvis
[_l_i_n_e][,_l_i_n_e] gglloobbaall /_r_e_g_e_x_p/ _c_o_m_m_a_n_d
Search the range of lines for all lines that contain
the regular expression regexp, and execute command
upon each.
[_l_i_n_e] iinnsseerrtt
Insert text before the current line.
[_l_i_n_e][,_l_i_n_e] jjooiinn
Concatenate the range of lines into one line.
[_l_i_n_e][,_l_i_n_e] lliisstt
Display the requested range of lines, making all em-
bedded control characters explicit.
mmaakkee [_t_a_r_g_e_t]
Same as the cc command, except that make is ex-
ecuted.
mmaapp[!] _k_e_y _m_a_p_p_e_d__t_o
Remap key to mapped_to. Normally, remapping applies
just to visual-command mode; `!' tells elvis to
remap the key under all modes. With no arguments,
show all current key mappings.
[_l_i_n_e] mmaarrkk _x
Set a mark on line, and name it x.
mmkkeexxrrcc
Save current configuration into file ./.exrc, which
will be read next time you invoke elvis.
[_l_i_n_e][,_l_i_n_e] mmoovvee _t_a_r_g_e_t_l_i_n_e
Move the range of lines to after targetline.
nneexxtt[!] [_f_i_l_e_s]
Switch to the next file on the elvis command line.
NNeexxtt[!]
Switch to the preceeding file on the elvis command
line.
[_l_i_n_e][,_l_i_n_e] nnuummbbeerr
Display the range of lines, with line numbers.
pprreevviioouuss[!]
Switch to the preceeding file on the elvis command
line.
[_l_i_n_e][,_l_i_n_e] pprriinntt
Display the specified range of lines.
[_l_i_n_e] ppuutt [``_x]
Copy text from cut buffer x after the current line.
COHERENT Lexicon Page 8
elvis Command elvis
qquuiitt[!]
Quit elvis, and return to the shell.
[_l_i_n_e] rreeaadd _f_i_l_e
Read the contents of file and insert them after line
(default, the last line).
rreewwiinndd[!]
Switch to the first file on the elvis command line.
sseett [_o_p_t_i_o_n_s]
Set an elvis option. With no arguments, list cur-
rent settings for all options.
sshheellll Invoke a shell.
ssoouurrccee _f_i_l_e
Read a set of colon-mode commands from file, and ex-
ecute them.
[_l_i_n_e][,_l_i_n_e] ssuubbssttiittuuttee /_r_e_g_e_x_p/_r_e_p_l_a_c_e_m_e_n_t/[_p][_g][_c]
For the range of lines, replace the first instance
of regexp with replacement. p tells elvis to print
the _l_a_s_t line upon which a substitution was per-
formed. g means perform a global substitution,
i.e., replace all instances of regexp on each line
with replacement. c tells elvis to ask for confir-
mation before performing each substitution.
ttaagg[!] _t_a_g_n_a_m_e
Find tagname in file tags, which records information
about all tags. If found, jump to the file and line
upon which the tag is set.
[_l_i_n_e][,_l_i_n_e] ttoo _t_a_r_g_e_t_l_i_n_e
Copy the range of lines to after the targetline.
uunnaabbbbrr _w_o_r_d
Unabbreviate word.
uunnddoo
Undo the last editing command.
uunnmmaapp[!] _k_e_y
Unmap key.
vveerrssiioonn
Display the current version of elvis.
[_l_i_n_e][,_l_i_n_e] vvgglloobbaall /_r_e_g_e_x_p/ _c_o_m_m_a_n_d
Search the range of lines for all lines that do not
contain the regular expression regexp, and execute
command upon each.
COHERENT Lexicon Page 9
elvis Command elvis
vviissuuaall
Enter visual-command mode.
wwqq
Save the changed file, and exit.
[_l_i_n_e][,_l_i_n_e] wwrriittee[!] [[>>]_f_i_l_e]
Write the file being edited into file. With the >>
argument, append the edited text onto the end of
file.
xxiitt[!]
Same as the wq command, described above, except that
it does not write files that have not changed.
[_l_i_n_e][,_l_i_n_e] yyaannkk [``_x]
Copy the range of lines into cut buffer x.
[_l_i_n_e][,_l_i_n_e] ! _c_o_m_m_a_n_d
Execute command under a subshell, then return.
[_l_i_n_e][,_l_i_n_e] <
Shift the range of lines left by one tabwidth.
[_l_i_n_e][,_l_i_n_e] =
With no range of lines specified, print the number
of the current line. With line arguments, print the
endpoints of the lines in question, and the number
of lines that lie between them. (Remember, line can
be a regular expression as well as a number.)
[_l_i_n_e][,_l_i_n_e] >
Shift the range of lines right by one tabwidth.
[_l_i_n_e][,_l_i_n_e] &
Repeat the last substitution command.
@ xx
Read the contents of cut-buffer x as a set of colon-
mode commands, and execute them.
***** Input Mode Commands ***** Most keystrokes are interpreted
as being text and inserted directly into the text; however, some
keystrokes are still interpreted as commands. Thus, you can per-
form an entire session of simple editing directly within input
mode without switching to either of the command modes.
The following summarizes the commands that can be executed
directly within input mode:
<ccttrrll-AA> Insert a copy of the last input text.
<ccttrrll-DD> Delete one indent character.
COHERENT Lexicon Page 10
elvis Command elvis
<ccttrrll-HH> Erase the character before the cursor.
<ccttrrll-LL> Redraw the screen.
<ccttrrll-MM> Insert a newline.
<ccttrrll-PP> Insert the contents of the cut buffer.
<ccttrrll-RR> Redraw the screen, like <ccttrrll-LL>.
<ccttrrll-TT> Insert an indent character.
<ccttrrll-UU> Move to the beginning of the line.
<ccttrrll-VV> Insert the following keystroke, even if special.
<ccttrrll-WW> Backspace to the beginning of the current word.
<ccttrrll-ZZ><ccttrrll-ZZ>
Write the file and exit elvis.
<eesscc> Shift from input mode to visual-command mode.
<ddeell> Delete the current character.
***** Command-line Options ***** elvis lets you name up to 27
files on the command line, thus allowing you to edit up to 27
files simultaneously. The ``next file'' and ``previous file''
commands described above allow you to shift from one file to
another during the same editing session; in this way, for ex-
ample, you can cut text from one file and paste it into another.
elvis recognizes the following command-line options:
-rr Recover a previous edit. Because elvis uses the program
vviirreecc for file recovery, invoking it with this option simply
prints a message that tells you to run virec.
-RR Invoke elvis in ``read-only'' mode. This is equivalent to
invoking elvis via the link view.
-tt _t_a_g
Begin editing at tag.
-mm [ _f_i_l_e ]
Invoke elvis in error-handling mode. It searches through
_f_i_l_e for something that looks like an error message from a
compiler, then positions the cursor at that point for
editing.
-ee Begin in colon-command mode.
-vv Begin in visual-command mode.
COHERENT Lexicon Page 11
elvis Command elvis
-ii Begin in input mode.
+_c_o_m_m_a_n_d
Execute command immediately upon beginning editing. For ex-
ample
elvis +237 foo
causes _e_l_v_i_s to move directly to line 237 immediately upon
beginning to edit file foo.
***** Files *****
/ttmmpp/eellvv* -- Temporary files
***** See Also *****
commands, ed, ex, me, vi, view
***** Notes *****
Full documentation for elvis is included with this release in
compressed file /usr/src/alien/Elvis.doc.Z.
elvis is a public-domain program written by Steve Kirkendall
([email protected] or ...uunet!tektronix!psueea!eecs!kirkenda),
assisted by numerous volunteers. Source code for it is available
through the Mark Williams bulletin board, USENET and numerous
other outlets.
elvis is distributed as a service to COHERENT customers, as is.
It is not supported by Mark Williams Company. Caveat utilitor.
COHERENT Lexicon Page 12
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.