

elvis                        Command                        elvis




Clone of UNIX-standard screen editor

eellvviiss [ _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

<ccttrrll-BB>     Move up by one screenful.

[_c_o_u_n_t] <ccttrrll-DD>
             Scroll down count  lines (default,  one-half screen-
             ful).

[_c_o_u_n_t] <ccttrrll-EE>
             Scroll up count lines.

<ccttrrll-FF>     Move down by one screenful.



COHERENT Lexicon                                           Page 1




elvis                        Command                        elvis



<ccttrrll-GG>     Show file status and the current line line.

[_c_o_u_n_t] <ccttrrll-HH>
             Move one character to the left.

[count] <ccttrrll-JJ>
             Move down count lines.

<ccttrrll-LL>     Redraw the screen.

[_c_o_u_n_t] <ccttrrll-MM>
             Move to the beginning of the next line.

[_c_o_u_n_t] <ccttrrll-NN>
             Move down count lines (default, one).

[_c_o_u_n_t] <ccttrrll-PP>
             Move up count lines (default, one).

<ccttrrll-RR>     Redraw the screen.

[_c_o_u_n_t] <ccttrrll-UU>
             Scroll up count lines (default, one-half screenful).

[_c_o_u_n_t] <ccttrrll-YY>
             Scroll down count lines.

<ccttrrll-]>     If the cursor is on a tag name, go to that tag.

<ccttrrll-^>     Switch to the previous file.

[_c_o_u_n_t] <ssppaaccee>
             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 ff or tt  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.

00            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 ff or tt 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] BB
             Move backwards count words (default, one).

[_c_o_u_n_t] EE
             Move forwards count words (default, one).

[count] FF _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] GG
             Move to to  the _c_o_u_n_t'th line in  the file (default,
             last).

[_c_o_u_n_t] HH
             Move to the top of the screen.

KK            Look up a keyword.

[_c_o_u_n_t] LL
             Move to the bottom of the screen.

MM            Move to the middle of the screen.

NN            Repeat the  last search, but in  the opposite direc-
             tion.


COHERENT Lexicon                                           Page 3




elvis                        Command                        elvis




PP            Paste text before the cursor.

QQ            Shift to colon-command mode.

[_c_o_u_n_t] TT _k_e_y
             Move left _a_l_m_o_s_t to the given character.

UU            Undo all recent changes to the current line.

[_c_o_u_n_t] UU
             Move forward count words (default, one).

[_c_o_u_n_t] YY
             Copy (or  ``yank'')  count lines  into a  cut buffer
             (default, one).

ZZ ZZ          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] bb
             Move back count words.

[_c_o_u_n_t] ee
             Move forward to the end of the _c_o_u_n_t'th word.

[_c_o_u_n_t] ff _k_e_y
             Move rightward  to  the _c_o_u_n_t'th  occurrence of  the
             given character.

[_c_o_u_n_t] hh
             Move left count characters (default, one).

[_c_o_u_n_t] jj
             Move down count characters (default, one).

[_c_o_u_n_t] kk
             Move up count characters (default, one).

[_c_o_u_n_t] ll
             Move right count characters (default, one).

mm _k_e_y        Mark a line or character.

nn            Repeat the previous search.




COHERENT Lexicon                                           Page 4




elvis                        Command                        elvis



pp            Paste text after the cursor.

[_c_o_u_n_t] tt _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).

uu            Undo the previous edit command.

[_c_o_u_n_t] ww
             Move forward count words (default, one).

yy _m_o_v_e
             Copy (or ``yank'') text into a cut buffer.

zz _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 :ss// command.

< _m_o_v_e
     Shift the enclosed text left.

> _m_o_v_e
     Shift the enclosed text right.

[_c_o_u_n_t] AA _i_n_p_u_t
     Append input at end of the line.

CC _i_n_p_u_t
     Change text from the cursor through the end of the line.

DD    Delete text from the cursor through the end of the line.

[_c_o_u_n_t] II _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] JJ
     Join lines the current with the following line.

[_c_o_u_n_t] OO _i_n_p_u_t
     Open a new line above the current line.

RR _i_n_p_u_t
     Overtype.

[_c_o_u_n_t] SS input
     Change lines, like cccc.

[_c_o_u_n_t] XX
     Delete  count  characters   from  the  left  of  the  cursor
     (default, one).

[_c_o_u_n_t] aa _i_n_p_u_t
     Insert text after the cursor.

cc _m_o_v_e
     Change text.

dd _m_o_v_e
     Delete text.

[_c_o_u_n_t] ii _i_n_p_u_t
     Insert text at the cursor.

[_c_o_u_n_t] oo _i_n_p_u_t
     Open a new line below the current line.

[_c_o_u_n_t] rr _k_e_y
     Replace count characters with text you type (default, one).

[_c_o_u_n_t] ss _i_n_p_u_t
     Replace count characters with text you type (default, one).

[_c_o_u_n_t] xx
     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.

aabbbbrr [_w_o_r_d _f_u_l_l__f_o_r_m]
     Define word as an abbreviation for full_form.

[_l_i_n_e] aappppeenndd
             Insert text after the current line.

aarrggss [_f_i_l_e_1 ... _f_i_l_e_N]
             With no arguments,  print the files  list on eellvviiss's
             command line.   With one  or more  arguments, change
             the name of the current file.

cccc [_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.

ccdd [_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] cchhaannggee [``_x]
             Replace the range of lines with the contents of cut-
             buffer x.

cchhddiirr [_d_i_r_e_c_t_o_r_y]
             Same as the cd command.

[_l_i_n_e][,_l_i_n_e] ccooppyy _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] ddeelleettee [``_x]
             Move the range of lines into cut buffer x.

ddiiggrraapphh[!] [_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.

eeddiitt[!] [_f_i_l_e]
             Edit a file not named on the elvis command line.

eerrrrlliisstt[!] [_e_r_r_l_i_s_t]
             Find the  next  error message  in  file errlist,  as
             generated through elvis's cc or make commands.

ffiillee [_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] gglloobbaall /_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] iinnsseerrtt
             Insert text before the current line.

[_l_i_n_e][,_l_i_n_e] jjooiinn
             Concatenate the range of lines into one line.

[_l_i_n_e][,_l_i_n_e] lliisstt
             Display the requested range of lines, making all em-
             bedded control characters explicit.

mmaakkee [_t_a_r_g_e_t]
             Same as  the  cc command,  except that  make is  ex-
             ecuted.

mmaapp[!] _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] mmaarrkk _x
             Set a mark on line, and name it x.

mmkkeexxrrcc
             Save current configuration into  file ./.exrc, which
             will be read next time you invoke elvis.

[_l_i_n_e][,_l_i_n_e] mmoovvee _t_a_r_g_e_t_l_i_n_e
             Move the range of lines to after targetline.

nneexxtt[!] [_f_i_l_e_s]
             Switch to the next file on the elvis command line.

NNeexxtt[!]
             Switch to the  preceeding file on  the elvis command
             line.

[_l_i_n_e][,_l_i_n_e] nnuummbbeerr
             Display the range of lines, with line numbers.

pprreevviioouuss[!]
             Switch to the  preceeding file on  the elvis command
             line.

[_l_i_n_e][,_l_i_n_e] pprriinntt
             Display the specified range of lines.

[_l_i_n_e] ppuutt [``_x]
             Copy text from cut buffer x after the current line.


COHERENT Lexicon                                           Page 8




elvis                        Command                        elvis




qquuiitt[!]
             Quit elvis, and return to the shell.

[_l_i_n_e] rreeaadd _f_i_l_e
             Read the contents of file and insert them after line
             (default, the last line).

rreewwiinndd[!]
             Switch to the first file on the elvis command line.

sseett [_o_p_t_i_o_n_s]
             Set an elvis  option.  With no  arguments, list cur-
             rent settings for all options.

sshheellll        Invoke a shell.

ssoouurrccee _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] ssuubbssttiittuuttee /_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.

ttaagg[!] _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] ttoo _t_a_r_g_e_t_l_i_n_e
             Copy the range of lines to after the targetline.

uunnaabbbbrr _w_o_r_d
             Unabbreviate word.

uunnddoo
             Undo the last editing command.

uunnmmaapp[!] _k_e_y
             Unmap key.

vveerrssiioonn
             Display the current version of elvis.

[_l_i_n_e][,_l_i_n_e] vvgglloobbaall /_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



vviissuuaall
             Enter visual-command mode.

wwqq
             Save the changed file, and exit.

[_l_i_n_e][,_l_i_n_e] wwrriittee[!] [[>>]_f_i_l_e]
             Write the file being edited into  file.  With the >>
             argument, append  the edited  text onto  the  end of
             file.

xxiitt[!]
             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] yyaannkk [``_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.

@ xx
             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:

<ccttrrll-AA>     Insert a copy of the last input text.

<ccttrrll-DD>     Delete one indent character.




COHERENT Lexicon                                          Page 10




elvis                        Command                        elvis



<ccttrrll-HH>     Erase the character before the cursor.

<ccttrrll-LL>     Redraw the screen.

<ccttrrll-MM>     Insert a newline.

<ccttrrll-PP>     Insert the contents of the cut buffer.

<ccttrrll-RR>     Redraw the screen, like <ccttrrll-LL>.

<ccttrrll-TT>     Insert an indent character.

<ccttrrll-UU>     Move to the beginning of the line.

<ccttrrll-VV>     Insert the following keystroke, even if special.

<ccttrrll-WW>     Backspace to the beginning of the current word.

<ccttrrll-ZZ><ccttrrll-ZZ>
             Write the file and exit elvis.

<eesscc>        Shift from input mode to visual-command mode.

<ddeell>        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:

-rr    Recover a  previous edit.  Because  elvis uses  the program
     vviirreecc for file recovery, invoking it with this option simply
     prints a message that tells you to run virec.

-RR   Invoke  elvis in ``read-only'' mode.   This is equivalent to
     invoking elvis via the link view.

-tt _t_a_g
     Begin editing at tag.

-mm [ _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.

-ee   Begin in colon-command mode.

-vv   Begin in visual-command mode.




COHERENT Lexicon                                          Page 11




elvis                        Command                        elvis



-ii   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 *****

/ttmmpp/eellvv* -- 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
(kirkenda@cs.pdx.edu 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


