Skip to Main Content
Linux in a Nutshell, Fourth Edition
book

Linux in a Nutshell, Fourth Edition

by Ellen Siever, Stephen Figgins, Aaron Weber
June 2003
Beginner to intermediate content levelBeginner to intermediate
944 pages
43h 1m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, Fourth Edition

vi Configuration

This section describes the following:

  • The :set command

  • Options available with :set

  • Sample ~/.exrc file

The :set Command

The :set command lets you specify options that change characteristics of your editing environment. Options may be put in the ~/.exrc file or set during a vi session.

The colon should not be typed if the command is put in ~/.exrc.

Command

Action

:set x

Enable option x.

:set no x

Disable option x.

:set x=val

Give value to option x.

:set

Show changed options.

:set all

Show all options.

:set x?

Show value of option x.

Options Used by :set

The following table describes the options to :set. The first column includes the optional abbreviation, if there is one, and uses an equals sign to show that the option takes a value. The second column gives the default, and the third column describes the behavior of the enabled option.

Option

Default

Description

autoindent (ai)

noai

In insert mode, indent each line to the same level as the line above or below.

autoprint (ap)

ap

Display changes after each editor command. (For global replacement, display last replacement.)

autowrite (aw)

noaw

Automatically write (save) file if changed, before opening another file with :n or before giving a Linux command with :!.

background (bg)

Describe the background so the editor can choose appropriate highlighting colors. Default value of dark or light depends on the environment in which the editor is invoked. {vim}

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

Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
Linux in Action

Linux in Action

David Clinton
Hands-On System Programming with Linux

Hands-On System Programming with Linux

Kaiwan N. Billimoria, Tigran Aivazian
Embedded Linux for Developers

Embedded Linux for Developers

Alexandru Vaduva, Alex González, Chris Simmonds

Publisher Resources

ISBN: 0596004826