Add files that used to be links.
authorJordan K. Hubbard <jkh@FreeBSD.org>
Mon, 24 Jan 1994 03:09:39 +0000 (03:09 +0000)
committerJordan K. Hubbard <jkh@FreeBSD.org>
Mon, 24 Jan 1994 03:09:39 +0000 (03:09 +0000)
usr.bin/vi/README [new file with mode: 0644]
usr.bin/vi/vi.1 [new file with mode: 0644]

diff --git a/usr.bin/vi/README b/usr.bin/vi/README
new file mode 100644 (file)
index 0000000..a33bfc6
--- /dev/null
@@ -0,0 +1,193 @@
+#      @(#)README      8.40 (Berkeley) 1/12/94
+
+This is the README for version 1.01 of nvi, a freely redistributable
+replacement for the vi and ex text editors.  It can be retrieved via
+anonymous ftp from ftp.uu.net, or from ftp.cs.berkeley.edu.  In the
+latter, it is in the directory ucb/4bsd, and is named nvi.tar.Z.
+
+If you have any questions or problems with nvi, please send them to
+me by electronic mail at one of the following addresses:
+
+       uunet!bostic
+       bostic@cs.berkeley.edu
+
+Keith Bostic
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+o Redistribution:
+
+Nvi is copyrighted by the The Regents of the University of California,
+but may be freely redistributed (or used to line your birdcage) under
+the following conditions:
+
+/*-
+ * Copyright (c) 1994
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+o Credit where it's due:
+
+       This software was originally derived from software contributed
+       to the University of California, Berkeley by Steve Kirkendall,
+       the author of the vi clone elvis.  Without his work, this work
+       would have been far more difficult.
+
+       POSIX 1003.2 style regular expression support is courtesy of
+       Henry Spencer, for which I am *very* grateful.
+
+       The curses library was originally done by Ken Arnold.  Scrolling
+       and general reworking for 4.4BSD was done by Elan Amir.
+
+o From the original vi acknowledgements, by William Joy and Mark Horton:
+
+       Bruce Englar encouraged the early development of this display
+       editor.  Peter Kessler helped bring sanity to version 2's
+       command layout.  Bill Joy wrote versions 1 and 2.0 through 2.7,
+       and created the framework that users see in the present editor.
+       Mark Horton added macros and other features and made the editor
+       work on a large number of terminals and Unix systems.
+
+o And...
+
+       The financial support of UUNET Communications Services is gratefully
+       acknowledged.
+
+=-=-=-=-=-=-=-=-=-=-=
+o Comments:
+
+This software is beta software, although it's pretty stable.  Almost
+of the necessary functionality for ex/vi is in it, the only missing
+pieces are fairly obscure.
+
+Code fixes are very much appreciated, of course, but if you can't
+provide them, please send me as much information as you can as to how
+to reproduce the bug, and I'll try to fix it here.  In particular, the
+screen routines are nasty stuff, and you probably don't want to mess
+with them.  Stack traces of core dumps are sometimes helpful, but an
+example file with a set of keystrokes that causes the problem is far
+better.
+
+Nvi is mostly 8-bit clean.  This isn't difficult to fix, and was left in
+during initial development to make things easier.  Wide character support
+will be integrated at the same time it is made fully 8-bit clean.
+
+=-=-=-=-=-=-=-=-=-=-=
+o New features:
+
+There aren't a lot of new features in nex/nvi, but there are a few things
+you might like:
+
+       o 8-bit clean data, practically infinite lines/files.
+               ^Vx[0-9A-Fa-f]* in input mode will insert any
+               legal character value.
+       o Split screens:
+               :sp[lit] [file ...] splits the screen.
+               ^W switches between screens.
+               :resize count grows/shrinks the current screen.
+       o Background/foreground screens
+               :bg backgrounds the current screen.
+               :di[splay] s[creens] lists the hidden screens.
+               :fg [file] foregrounds the specified (or next) screen.
+       o Shell screens:
+               :sc[ript] [file ...] runs a shell in the screen.
+               Carriage return sends a line to the shell.
+       o Buffer, screens, tags display:
+               :di[splay] b[uffers] displays the current cut buffers.
+               :di[splay] s[creens] displays the hidden screen names.
+               :di[splay] t[ags] displays the current tags stack.
+       o Tag stacks:
+               ^T returns to previous tag location.
+               :tagpop [number | file] returns to previous tag location,
+                    or, optionally tag #N, or the tag in a specific file.
+               :tagtop returns to first tag location.
+       o Infinite undo:
+               A '.' command immediately after a 'u' command continues
+               either forward or backward depending on whether the 'u'
+               command was an undo or a redo.
+       o Usage information:
+               :exu[sage] [cmd] for ex commands.
+               :viu[sage] [key] for vi commands.
+               :help
+       o Extended RE expressions:
+               :set extended turns on extended RE's, so you can
+                   do "/in|or" and search for the next occurrence of
+                   more than one expression.
+       o Word search:
+               ^A searches for the word referenced by the cursor.
+       o Number increment:
+               # increments the number referenced by the cursor.
+       o Previous file:
+               :prev[ious][!] edits the previous file from the
+               argument list.
+
+=-=-=-=-=-=-=-=-=-=-=
+o Porting information:
+
+The directory PORT has directories per machine/OS combination, with
+V7-style Makefiles which build nvi.  See the file PORT/README for
+more detailed information.
+
+=-=-=-=-=-=-=-=-=-=-=
+o Directories:
+
+The main directory, nvi, contains source files for pieces of code that
+are shared by all the editors, like searching and logging code or code
+translating line numbers into requests to the dbopen(3) database code.
+It also has the code for adding, deleting, and changing "records" in
+the underlying database.
+
+nvi/docs:
+       The nvi/docs directory has technical information about data
+       structures and some of the trickier parts of vi like quoting,
+       key mapping, input queues, and executing buffers, and a
+       description of how nvi does edit session recovery.
+
+nvi/ex:
+       The nvi/ex directory is the ex source code.  Because vi has the
+       colon command, lots of this code is used by vi.  Generally, if
+       functionality is shared by both ex and vi, it's in nvi/ex, if
+       it's vi only, it's in nvi/vi.  Files are generally named by the
+       command(s) they support, but occasionally with a name that
+       describes their functionality.
+
+nvi/sex:
+       The nvi/sex directory is the screen support for the ex editor.
+
+nvi/svi:
+       The nvi/svi directory is the screen support for a curses based
+       vi editor.
+
+nvi/vi:
+       The nvi/vi directory is the vi source code.
+
+nvi/xaw:
+       Place reserved for an X11 (Athena Widget) screen.
diff --git a/usr.bin/vi/vi.1 b/usr.bin/vi/vi.1
new file mode 100644 (file)
index 0000000..0dde0e0
--- /dev/null
@@ -0,0 +1,395 @@
+.\" Copyright (c) 1994
+.\"     The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)vi.1       8.1 (Berkeley) 1/12/94
+.\"
+.Dd "January 12, 1994"
+.Dt EX/VI 1
+.Os
+.Sh Name
+.Nm ex, vi, view
+.Nd text editors
+.Sh SYNOPSIS
+.Nm vi
+.Op Fl eFlRv
+.Op Fl c Ar command
+.Op Fl r Ar file
+.Op Fl t Ar tag
+.Op Fl w Ar size
+.Op Fl x Ar aw
+.br
+.Nm view
+.Op Fl eFlRv
+.Op Fl c Ar command
+.Op Fl r Ar file
+.Op Fl t Ar tag
+.Op Fl w Ar size
+.Op Fl x Ar aw
+.br
+.Nm ex
+.Op Fl eFlRsv
+.Op Fl c Ar command
+.Op Fl r Ar file
+.Op Fl t Ar tag
+.Op Fl w Ar size
+.Op Fl x Ar aw
+.Sh DESCRIPTION
+.Nm Ex
+is a line-oriented text editor.
+.Nm Vi
+is a screen oriented text editor, based on
+.Nm ex .
+.Nm View
+is the same as using the
+.Fl R
+(read-only) option of
+.Nm vi .
+.Nm Ex
+and
+.Nm vi
+are really different interfaces to the same program,
+and it is possible to switch back and forth during the same edit session.
+.Pp
+This manual page is the one provided with the
+.Nm nex
+and
+.Nm nvi
+versions of the vi text editors.
+.Nm Nex
+and
+.Nm nvi
+are intended as bug-for-bug compatible replacements for the original
+Fourth Berkeley Software Distribution (4BSD)
+.Nm ex
+and
+.Nm vi
+programs.
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl c
+Execute
+.Ar command
+immediately after starting the edit session.
+Useful for initial positioning in the file, but
+.Ar command
+is not limited to positioning commands.
+This is the POSIX 1003.2 interface for the historic
+.Dq +command
+syntax.
+.Nm Nex/nvi
+supports both the old and new syntax.
+.It Fl e
+Start editing in ex mode, as if the command name was
+.Nm ex .
+.It Fl F
+Don't copy the entire file when first starting to edit.
+(The default is to make a copy in case someone else tries to edit
+the file too.)
+.It Fl l
+List the files that may be recovered using the
+.Fl r
+option of
+.Nm vi .
+This is the new interface for the historic
+.Fl r
+without a file argument syntax.
+.Nm Nex/nvi
+supports both the old and new syntax.
+.It Fl R
+Start editing in read-only mode, as if the command name was
+.Nm view .
+.It Fl r
+Recover the specified file.
+.It Fl s
+Enter batch mode; applicable only to
+.Nm ex
+edit sessions.
+Batch mode is useful when running
+.Nm ex
+scripts.
+Prompts, informative messages and other user oriented things are
+turned off.
+This is the POSIX 1003.2 interface for the historic
+.Fl \-
+syntax.
+.Nm Nex/nvi
+supports both the old and new syntax.
+.It Fl t
+Start editing at the specified tag.
+(See
+.Xr ctags 1 ).
+.It Fl w
+Set the initial window size to the specified number of lines.
+.It Fl v
+Start editing in vi mode, as if the command name was
+.Nm vi
+or
+.Nm view .
+.It Fl x
+Reserved for X11 interfaces.
+Not currently implemented.
+.Sh ADDITIONAL FEATURES
+This manual page is the one distributed with the
+.Nm nvi
+and
+.Nm nex
+reimplementations of
+.Nm ex/vi .
+There are a few additional features in
+.Nm nex/nvi .
+.Bl -tag -width indent
+.It "8-bit clean data, large lines, files"
+.Nm Nvi/nex
+will edit any format file.
+Line lengths are limited by available memory,
+and file sizes are limited by available disk space.
+The command
+.Dq ^Vx[0-9A-Fa-f]* ,
+in input mode, will insert any
+legal character value into the text.
+.It "Split screens"
+The command
+.Dq :sp[lit] [file ...]
+splits the screen in vi mode.
+The key
+.Dq ^W
+switches between the foreground screens,
+and the
+.Dq :resize count
+command can be used to grow or shrink any
+particular screen.
+.It "Background and foreground screens"
+The command
+.Dq :bg
+backgrounds the current screen,
+and the command
+.Dq :fg [file]
+foregrounds the backgrounded screeen
+that is editing the specified file, or, by default, the first background
+screen on the queue.
+The command
+.Dq :di[splay] s[creens]
+lists the background screens.
+.It "Shell screens"
+The command
+.Dq :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.
+.It "Tag stacks"
+Tags are now maintained in a stack.
+The command
+.Dq ^T
+returns to the previous tag location.
+The command
+.Dq :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
+.Dq :di[splay] t[ags]
+to view the tags stack.
+The command
+.Dq :tagtop
+returns to the top of the tag stack.
+.It "New displays"
+The command
+.Dq :di[splay] b[uffers] \| s[creens] \| t[ags]
+can be
+used to display, respectively, the current cut buffers,
+the backgrounded screens, and the tags stack.
+.It "Infinite undo"
+The changes made during an edit session may be rolled backward and
+forward.
+A '.' command immediately after a 'u' command continues either forward
+or backward depending on whether the 'u' command was an undo or a redo.
+.It "Usage information"
+The command
+.Dq :exu[sage [cmd]
+and
+.Dq viu[sage] [key]
+provide usage
+information for all of the ex and vi commands by default, or, optionally,
+for a specific command or key.
+.It "Extended regular expressions"
+The
+.Dq :set extended
+command treats search and other command regular
+expressions as extended (egrep(1) style) regular expressions.
+.It "Word search"
+The command
+.Dq ^A
+searches for the word referenced by the cursor.
+.It "Number increment"
+The command
+.Dq #
+increments the number referenced by the cursor.
+.It "Previous file"
+The command
+.Dq :prev[ious][!]
+edits the previous file from the
+argument list.
+.It "Left-Right scrolling"
+The command
+.Dq :set leftright
+makes
+.Nm nvi
+do left-right screen scrolling, instead of the traditional
+.Nm vi
+line wrapping.
+.Sh RECOVERY
+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.
+.Pp
+Edit sessions are backed by files in
+.Pa /var/tmp/vi.recover ,
+and are named
+.Dq vi.XXXX ,
+where
+.Dq 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
+.Dq recover.XXXX ,
+where, again,
+.Dq 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
+.Dq preserve
+command.
+The use of the
+.Pa /var/tmp
+directory may be changed setting the option
+.Dq recdir
+in the user's or system startup information.
+.Pp
+The recovery directory should have the
+.Dq sticky-bit
+set so that only the owners of files may remove them.
+If this is not possible on the system, then a pseudo-user should
+own the recovery directory.
+The recovery directory must be both read and write-able by
+any user.
+.Pp
+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
+.Pa /var/tmp/vi.recover
+named
+.Dq recover.XXXX
+should be sent by email,
+using the
+.Fl 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 file:
+.sp
+.ne 7v
+.Bd -literal -offset indent -compact
+# Recover nvi editor files.
+virecovery=/var/tmp/vi.recover/recover.*
+if [ $virecovery != /var/tmp/vi.recover/recover.\e* ]; then
+       echo 'Recovering vi editor sessions'
+       for i in $virecovery; do
+               sendmail -t < $i
+       done
+.Ed
+.Pp
+If
+.Nm nex/nvi
+receives a hangup (SIGHUP) signal, it will email the recovery
+information to the user itself.
+.Pp
+If you don't have the sendmail program on your system, the source file
+.Pa nvi/recover.c
+will have to be modified to use your mail delivery programs.
+.Sh BUGS
+This man page is woefully incomplete.
+.Pp
+Many and varied.
+See the file
+.Pa nvi/docs/BUGS
+for a list of the known bugs in this version.
+.Sh FILES
+.Bl -tag -width XXXX/var/tmp/vi.recover -compact
+.It Pa /tmp
+Storage for temporary files.
+.It Pa /var/tmp/vi.recover
+Storage for recovery files.
+.El
+.Sh SEE ALSO
+.Xr ctags 1 ,
+.Xr more 1 ,
+.Xr curses 3 ,
+.Xr dbopen 3
+.sp
+The
+.Dq Vi Quick Reference
+card.
+.sp
+.Dq An Introduction to Display Editing with Vi ,
+found in the
+.Dq UNIX User's Manual Supplementary Documents .
+.sp
+.Dq Edit: A tutorial ,
+found in the
+.Dq UNIX User's Manual Supplementary Documents .
+.sp
+.Dq Ex Reference Manual (Version 3.7) ,
+found in the
+.Dq UNIX User's Manual Supplementary Documents .
+.sp
+The files
+.Dq autowrite ,
+.Dq input ,
+and
+.Dq quoting ,
+found in the
+.Pa nvi/docs
+directory of the
+.Nm nex/nvi
+source code.
+.Sh HISTORY
+The
+.Nm nex/nvi
+replacements for
+.Nm ex/vi
+first appeared in 4.4BSD.
+.Sh STANDARDS
+.Nm Nex/nvi
+is fairly close to IEEE Std1003.2 (``POSIX''), but it's
+not there yet.