You are previewing vi and Vim Editors Pocket Reference, 2nd Edition.

vi and Vim Editors Pocket Reference, 2nd Edition

Cover of vi and Vim Editors Pocket Reference, 2nd Edition by Arnold Robbins Published by O'Reilly Media, Inc.
  1. vi and Vim Editors Pocket Reference
  2. 1. vi and Vim Editors Pocket Reference
    1. Introduction
    2. Conventions
    3. Acknowledgments
    4. Command-Line Options
    5. vi Commands
      1. Movement Commands
      2. Editing Commands
      3. Exit Commands
      4. Solaris vi Command-Mode Tag Commands
      5. Buffer Names
      6. Buffer and Marking Commands
    6. Input Mode Shortcuts
      1. Word Abbreviation
      2. Command and Input Mode Maps
      3. Executable Buffers
      4. Automatic Indentation
    7. Substitution and Regular Expressions
      1. The Substitute Command
      2. vi Regular Expressions
      3. POSIX Bracket Expressions
      4. Metacharacters Used in Replacement Strings
      5. More Substitution Tricks
    8. ex Commands
      1. Command Syntax
      2. Address Symbols
      3. Command Option Symbols
      4. Alphabetical List of Commands
    9. Initialization
    10. Recovery
    11. vi set Options
    12. Nothing like the Original
    13. Enhanced Tags and Tag Stacks
      1. Exuberant ctags
      2. Solaris vi Tag Stacking
    14. Vim—vi Improved
      1. Important Command-Line Options
      2. Vim Window Management
      3. Tabbed Editing
      4. Vim Extended Regular Expressions
      5. Command-Line History and Completion
      6. Tag Stacks
      7. Edit-Compile Speedup
      8. Programming Assistance
      9. Folding and Unfolding Text
      10. Insertion Completion Facilities
      11. Diff Mode
      12. Vim Scripting
      13. Vim set Options
    15. nvi—New vi
      1. Important Command-Line Options
      2. nvi Window Management Commands
      3. nvi Extended Regular Expressions
      4. Command-Line History and Completion Options
      5. Tag Stacks
      6. nvi 1.79 set Options
    16. elvis
      1. Important Command-Line Options
      2. elvis Window Management
      3. elvis Extended Regular Expressions
      4. Command-Line History and Completion Movement Keys
      5. Tag Stacks
      6. Edit-Compile Speedup
      7. elvis 2.2 set Options
    17. vile—vi like Emacs
      1. Important Command-Line Options
      2. vile Window Management Commands
      3. vile Extended Regular Expressions
      4. Command-Line History and Completion
      5. Tag Stacks
      6. Edit-Compile Speedup
      7. vile 9.8 set Options
    18. Internet Resources for vi
    19. Program Source and Contact Information
  3. Index
  4. About the Author
  5. Copyright
O'Reilly logo

Vim—vi Improved

Vim is the most powerful and most popular of the vi clones currently in use. It is the default version of vi on most GNU/Linux systems.

Important Command-Line Options

-b

Start in binary mode.

-c command

Execute command at startup (POSIX version of the historical +command).

-C

Run in vi compatibility mode.

-f

For the GUI version, stay in the foreground.

-g

Start the GUI version of Vim, if Vim was compiled with support for the GUI.

-i viminfo

Read the given viminfo file for initialization instead of the default viminfo file.

-o [N]

Open N windows, if given; otherwise, open one window per file.

-O [N]

Like -o, but split the windows vertically.

-n

Don’t create a swap file: recovery won’t be possible.

-p

Open a new tab for each file named on the command line.

-q filename

Treat filename as the “quick fix” file.

-R

Start in read-only mode, setting the readonly option.

-s

Enter batch (script) mode. This is only for ex and intended for running editing scripts (POSIX version of the historical “–” argument).

-u vimrc

Read the given .vimrc file for initialization and skip all other normal initialization steps.

-U gvimrc

Read the given .gvimrc file for GUI initialization and skip all other normal GUI initialization steps.

-y

Enter “easy” mode, which provides more intuitive behavior for beginners.

-Z

Enter restricted mode (same as having a leading r in the name).

Vim Window Management

Vim lets you split the screen into multiple windows and control their size and placement.

Window management commands—ex

Command

Function ...

The best content for your career. Discover unlimited learning on demand for around $1/day.