nvi is a vi clone created for the 4.4BSD Berkeley Unix release. It’s intended to be “bug-for-bug” compatible with the original, although it does have a number of extensions over the original vi.
-F
Don’t copy the entire file when starting to edit.
-R
Start in read-only mode, setting the
readonly
option.
-s
Enter batch (script) mode. This is only for ex and is intended for running editing scripts. Prompts and nonerror messages are disabled.
-S
Run with the secure
option set,
disallowing access to external programs.
Command | Function |
---|---|
| Hide the current window |
| Display all buffers, including named, unnamed, and numeric buffers |
| Display the filenames of all backgrounded windows |
| Edit filename in a new window |
| Create a new window editing an empty buffer; /tmp is interpreted specially to create a new temporary file |
| Uncover filename into the current window |
| Uncover filename in a new window; the current window is split |
| Edit the next file in the argument list in a new window |
| Edit the previous file in the argument list in a new window |
| Increase or decrease the size of the current window by nrows rows |
| Edit the file containing tagstring in a new window |
The ^W
command cycles between windows, top to
bottom. The :q
and ZZ
commands
exit the current window.
You may have multiple windows open on the same file. Changes made in one window are reflected in the other.
You use :set extended
to enable extended regular expression matching:
|
Indicates alternation. The left and right sides don’t need to be single characters.
+
Matches one or more of the preceding regular expressions. This is either a single character or a group of characters enclosed in parentheses.
?
Matches zero or one occurrence of the preceding regular expression.
(...)
Used for grouping, to allow the application of additional regular expression operators.
{...}
Describes an interval expression (interval expressions were defined in Vim Extended Regular Expressions).
When extended
isn’t set, use
{
and }
.
When extended
is set, you should precede the
above metacharacters with a backslash in order to match them
literally.
Option | Description |
---|---|
| The first character of this string, when used on the colon command line, provides access to the command history; pressing ENTER on any given line executes that line. |
| The first character of this string, when used on
the colon command line, does shell-style filename expansion;
when this character is the same as for the
|
Both of these options are not set by default. Set them in your $HOME/.nexrc file.
nvi provides both ex and vi commands for managing the tag stack.
Command | Function |
---|---|
| Display the tag stack |
| Edit the file containing tagstring as defined in the tags file |
| Just like |
| Pop to the given tag or to the most recently used tag if no tagloc is supplied |
| Pop to the oldest tag in the stack, clearing the stack in the process |
Option | Default |
---|---|
| |
| Environment variable |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| /var/tmp/vi.recover |
| |
| |
| |
| |
| |
| 16 |
| 0 |
| tags /var/db/libc.tags /sys/kern/tags |
| |
|
18.222.109.141