Skip to Main Content
vi and Vim Editors Pocket Reference, 2nd Edition
book

vi and Vim Editors Pocket Reference, 2nd Edition

by Arnold Robbins
January 2011
Intermediate to advanced content levelIntermediate to advanced
94 pages
1h 52m
English
O'Reilly Media, Inc.
Content preview from vi and Vim Editors Pocket Reference, 2nd Edition

nvi—New vi

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.

Important Command-Line Options

-c command

Execute command at startup.

-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.

nvi Window Management Commands

Command

Function

bg

Hide the current window

di[splay] b[uffers]

Display all buffers, including named, unnamed, and numeric buffers

di[splay] s[creens]

Display the filenames of all backgrounded windows

Edit filename

Edit filename in a new window

Edit /tmp

Create a new window editing an empty buffer; /tmp is interpreted specially to create a new temporary file

fg filename

Uncover filename into the current window

Fg filename

Uncover filename in a new window; the current window is split

Next

Edit the next file in the argument list in a new window

Previous

Edit the previous file in the argument list in a new window

resize ±nrows

Increase or decrease the size of the current window by nrows rows

Tag tagstring

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro Vim

Pro Vim

Mark McDonnell
Learning the vi and Vim Editors, 7th Edition

Learning the vi and Vim Editors, 7th Edition

Arnold Robbins, Elbert Hannah, Linda Lamb

Publisher Resources

ISBN: 9781449303082Errata Page