Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Startup and Initialization Options

Vim uses different mechanisms to set up its environment at startup. It inspects command-line options. It self-inspects (how was it invoked, and by what name?). There are different compiled binaries to serve different needs (GUI versus text window). Vim also uses a sequence of initialization files in which uncountable combinations of behaviors can be defined and modified. There are too many options to cover completely; we will touch on some of the interesting ones. In the next sections, we discuss Vim’s starting sequence along the following lines:

  • Command-line options

  • Behaviors associated to command name

  • Configuration files (system-wide and per-user)

  • Environment variables

This section introduces you to some of the ways to start Vim. For a more detailed discussion of many more options, use the help command:

:help startup

Command-Line Options

Vim’s command-line options provide flexibility and power. Some options invoke extra features, whereas others override and suppress default behavior. We will discuss the command-line syntax as it would be used in a typical Unix environment. Single-letter options begin with - (one hyphen), as in -b, which allows editing of binary files. Word-length options begin with -- (two hyphens), as in --noplugin, which overrides the default behavior of loading plugins. A command-line argument of two hyphens by themselves tells Vim that the rest of the command line contains no options (this is a standard Unix behavior).

Following the ...

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

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page