
NNaammee
     eexx,, vvii,, vviieeww - text editors

SSYYNNOOPPSSIISS
     vvii [--eeFFllRRvv] [--cc _c_o_m_m_a_n_d] [--rr _f_i_l_e] [--tt _t_a_g] [--ww _s_i_z_e] [--xx _a_w]
     vviieeww [--eeFFllRRvv] [--cc _c_o_m_m_a_n_d] [--rr _f_i_l_e] [--tt _t_a_g] [--ww _s_i_z_e] [--xx _a_w]
     eexx [--eeFFllRRssvv] [--cc _c_o_m_m_a_n_d] [--rr _f_i_l_e] [--tt _t_a_g] [--ww _s_i_z_e] [--xx _a_w]

DDEESSCCRRIIPPTTIIOONN
     EExx is a line-oriented text editor.  VVii is a screen oriented text editor,
     based on eexx. VViieeww is the same as using the --RR (read-only) option of vvii.
     EExx and vvii are really different interfaces to the same program, and it is
     possible to switch back and forth during the same edit session.

     This manual page is the one provided with the nneexx and nnvvii versions of the
     vi text editors.  NNeexx and nnvvii are intended as bug-for-bug compatible re-
     placements for the original Fourth Berkeley Software Distribution (4BSD)
     eexx and vvii programs.

     The following options are available:

     --cc      Execute _c_o_m_m_a_n_d immediately after starting the edit session.
             Useful for initial positioning in the file, but _c_o_m_m_a_n_d is not
             limited to positioning commands.  This is the POSIX 1003.2 inter-
             face for the historic ``+command'' syntax.  NNeexx//nnvvii supports both
             the old and new syntax.

     --ee      Start editing in ex mode, as if the command name was eexx.

     --FF      Don't copy the entire file when first starting to edit.  (The de-
             fault is to make a copy in case someone else tries to edit the
             file too.)

     --ll      List the files that may be recovered using the --rr option of vvii.
             This is the new interface for the historic --rr without a file ar-
             gument syntax.  NNeexx//nnvvii supports both the old and new syntax.

     --RR      Start editing in read-only mode, as if the command name was vviieeww.

     --rr      Recover the specified file.

     --ss      Enter batch mode; applicable only to eexx edit sessions.  Batch
             mode is useful when running eexx scripts.  Prompts, informative
             messages and other user oriented things are turned off.  This is
             the POSIX 1003.2 interface for the historic ---- syntax.  NNeexx//nnvvii
             supports both the old and new syntax.

     --tt      Start editing at the specified tag.  (See ctags(1)).

     --ww      Set the initial window size to the specified number of lines.

     --vv      Start editing in vi mode, as if the command name was vvii or vviieeww.

     --xx      Reserved for X11 interfaces.  Not currently implemented.

AADDDDIITTIIOONNAALL FFEEAATTUURREESS
     This manual page is the one distributed with the nnvvii and nneexx reimplemen-
     tations of eexx//vvii. There are a few additional features in nneexx//nnvvii.

     8-bit clean data, large lines, files
             NNvvii//nneexx will edit any format file.  Line lengths are limited by
             available memory, and file sizes are limited by available disk
             space.  The command ``^Vx[0-9A-Fa-f]*'', in input mode, will in-


             sert any legal character value into the text.

     Split screens
             The command ``:sp[lit] [file ...]'' splits the screen in vi mode.
             The key ``^W'' switches between the foreground screens, and the
             ``:resize count'' command can be used to grow or shrink any par-
             ticular screen.

     Background and foreground screens
             The command ``:bg'' backgrounds the current screen, and the com-
             mand ``:fg [file]'' foregrounds the backgrounded screeen that is
             editing the specified file, or, by default, the first background
             screen on the queue.  The command ``:di[splay] s[creens]'' lists
             the background screens.

     Shell screens
             The command ``:sc[ript] [file ...]'' runs a shell in the screen.
             Editing is unchanged, with the exception that a <carriage-return>
             enters the current line (stripped of any prompt) as input to the
             shell.

     Tag stacks
             Tags are now maintained in a stack.  The command ``^T'' returns
             to the previous tag location.  The command ``:tagpop [number
             file]'' returns to the most recent tag location by default, or,
             optionally to a specific tag number in the tag stack, or the most
             recent tag from the specified file.  Use the command ``:di[splay]
             t[ags]'' to view the tags stack.  The command ``:tagtop'' returns
             to the top of the tag stack.

     New displays
             The command ``:di[splay] b[uffers]  s[creens]  t[ags]'' can be
             used to display, respectively, the current cut buffers, the back-
             grounded screens, and the tags stack.

     Infinite undo
             The changes made during an edit session may be rolled backward
             and forward.  A '.' command immediately after a 'u' command con-
             tinues either forward or backward depending on whether the 'u'
             command was an undo or a redo.

     Usage information
             The command ``:exu[sage [cmd]'' and ``viu[sage] [key]'' provide
             usage information for all of the ex and vi commands by default,
             or, optionally, for a specific command or key.

     Extended regular expressions
             The ``:set extended'' command treats search and other command
             regular expressions as extended (egrep(1) style) regular expres-
             sions.

     Word search
             The command ``^A'' searches for the word referenced by the cur-
             sor.

     Number increment
             The command ``#'' increments the number referenced by the cursor.

     Previous file
             The command ``:prev[ious][!]'' edits the previous file from the
             argument list.

     Left-Right scrolling
             The command ``:set leftright'' makes nnvvii do left-right screen
             scrolling, instead of the traditional vvii line wrapping.

RREECCOOVVEERRYY
     There is no recovery program for nvi, nor does it run setuid.  Users may
     recover any file which they may read, and the superuser may recover any
     edit session.

     Edit sessions are backed by files in _/_v_a_r_/_t_m_p_/_v_i_._r_e_c_o_v_e_r, and are named
     ``vi.XXXX'', where ``XXXX'' is a number related to the process id.  When
     a file is first modified, a second file, which contains an email message
     for the user, is created, and is named ``recover.XXXX'', where, again,
     ``XXXX'' is associated with the process id.  Both files are removed at
     the end of a normal edit session, but will remain if the edit session is
     abnormally terminated or the user enters the ex/vi ``preserve'' command.
     The use of the _/_v_a_r_/_t_m_p directory may be changed setting the option
     ``recdir'' in the user's or system startup information.

     The recovery directory should have the ``sticky-bit'' set so that only
     the owners of files may remove them.  If this is not possible on the sys-
     tem, then a pseudo-user should own the recovery directory.  The recovery
     directory must be both read and write-able by any user.

     The recovery file has all of the necessary information in it to enable
     the user to recover the edit session.  In addition, it has all of the
     necessary email headers for sendmail.  When the system is rebooted, all
     of the files in _/_v_a_r_/_t_m_p_/_v_i_._r_e_c_o_v_e_r named ``recover.XXXX'' should be sent
     by email, using the --tt flag of sendmail (or a similar mechanism in other
     mailers).  A simple way to do this is to insert the following script into
     your rc.local (or other startup) file:

           # Recover nvi editor files.
           virecovery=/var/tmp/vi.recover/recover.*
           if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then
                   echo 'Recovering vi editor sessions'
                   for i in $virecovery; do
                           sendmail -t < $i
                   done
           fi

     If nneexx//nnvvii receives a hangup (SIGHUP) signal, it will email the recovery
     information to the user itself.

     If you don't have the sendmail program on your system, the source file
     _n_v_i_/_r_e_c_o_v_e_r_._c will have to be modified to use your mail delivery pro-
     grams.

BBUUGGSS
     This man page is woefully incomplete.

     Many and varied.  See the file _n_v_i_/_d_o_c_s_/_b_u_g_s_._c_u_r_r_e_n_t for a list of the
     known bugs in this version.

FFIILLEESS
     /tmp                     Storage for temporary files.
     /var/tmp/vi.recover      Storage for recovery files.

SSEEEE AALLSSOO
     ctags(1),  more(1),  curses(3),  dbopen(3)

     The ``Vi Quick Reference'' card.

     ``Introduction to Display Editing with Vi'', found in the ``UNIX User's
     Manual Supplementary Documents''.

     ``Edit: A tutorial'', found in the ``UNIX User's Manual Supplementary
     Documents''.

     ``Ex Reference Manual (Version 3.7)'', found in the ``UNIX User's Manual
     Supplementary Documents''.

     NNrrooffff//ttrrooffff source for the previous three documents are distributed with
     nneexx//nnvvii in the _n_v_i_/_d_o_c_s_/_U_S_D_._d_o_c directory of the nneexx//nnvvii source code.

     The files ``autowrite'', ``input'', and ``quoting'', found in the
     _n_v_i_/_d_o_c_s directory of the nneexx//nnvvii source code.

HHIISSTTOORRYY
     The nneexx//nnvvii replacements for eexx//vvii first appeared in 4.4BSD.

SSTTAANNDDAARRDDSS
     NNeexx//nnvvii is fairly close to IEEE Std1003.2 (``POSIX''), but it's not there
     yet.




















































