You are previewing Learning the vi Editor, Sixth Edition.
O'Reilly logo
Learning the vi Editor, Sixth Edition

Book Description

For many users, working in the Unix environment means using vi, a full-screen text editor available on most Unix systems. Even those who know vi often make use of only a small number of its features. Learning the vi Editor is a complete guide to text editing with vi. Topics new to the sixth edition include multiscreen editing and coverage of four viclones: vim, elvis, nvi, and vile and their enhancements to vi, such as multi-window editing, GUI interfaces, extended regular expressions, and enhancements for programmers. A new appendix describes vi's place in the Unix and Internet cultures. Quickly learn the basics of editing, cursor movement, and global search and replacement. Then take advantage of the more subtle power of vi. Extend your editing skills by learning to use ex, a powerful line editor, from within vi. For easy reference, the sixth edition also includes a command summary at the end of each appropriate chapter. Topics covered include:

  • Basic editing

  • Moving around in a hurry

  • Beyond the basics

  • Greater power with ex

  • Global search and replacement

  • Customizing vi and ex

  • Command shortcuts

  • Introduction to the vi clones' extensions

  • The nvi, elvis, vim, and vile editors

  • Quick reference to vi and ex commands

  • vi and the Internet

  • Table of Contents

    1. Copyright
    2. Dedication
    3. Preface
      1. Scope of This Handbook
      2. How the Material Is Presented
      3. What You Need to Know Before Starting
      4. Comments and Questions
      5. About the Previous Edition
      6. Preface to the 6th Edition
    4. Basic and Advanced vi
      1. The vi Text Editor
        1. Opening and Closing Files
        2. Quitting Without Saving Edits
      2. Simple Editing
        1. vi Commands
        2. Moving the Cursor
        3. Simple Edits
        4. More Ways to Insert Text
        5. Joining Two Lines with J
        6. Review of Basic vi Commands
      3. Moving Around in a Hurry
        1. Movement by Screens
        2. Movement by Text Blocks
        3. Movement by Searches
        4. Movement by Line Number
        5. Review of vi Motion Commands
      4. Beyond the Basics
        1. More Command Combinations
        2. Options When Starting vi
        3. Making Use of Buffers
        4. Marking Your Place
        5. Other Advanced Edits
        6. Review of vi Buffer and Marking Commands
      5. Introducing the ex Editor
        1. ex Commands
        2. Editing with ex
        3. Saving and Exiting Files
        4. Copying a File into Another File
        5. Editing Multiple Files
      6. Global Replacement
        1. Confirming Substitutions
        2. Context-Sensitive Replacement
        3. Pattern-Matching Rules
        4. Pattern-Matching Examples
        5. A Final Look at Pattern Matching
      7. Advanced Editing
        1. Customizing vi
        2. Executing UNIX Commands
        3. Saving Commands
        4. Using ex Scripts
        5. Editing Program Source Code
    5. Extensions and Clones
      1. vi Clones Feature Summary
        1. And These Are My Brothers, Darrell, Darrell, and Darrell
        2. Multiwindow Editing
        3. GUI Interfaces
        4. Extended Regular Expressions
        5. Enhanced Tags
        6. Improved Facilities
        7. Programming Assistance
        8. Editor Comparison Summary
        9. A Look Ahead
      2. nvi—New vi
        1. Author and History
        2. Important Command-Line Arguments
        3. Online Help and Other Documentation
        4. Initialization
        5. Multiwindow Editing
        6. GUI Interfaces
        7. Extended Regular Expressions
        8. Improvements for Editing
        9. Programming Assistance
        10. Interesting Features
        11. Sources and Supported Operating Systems
      3. elvis
        1. Author and History
        2. Important Command-Line Arguments
        3. Online Help and Other Documentation
        4. Initialization
        5. Multiwindow Editing
        6. GUI Interfaces
        7. Extended Regular Expressions
        8. Improved Editing Facilities
        9. Programming Assistance
        10. Interesting Features
        11. elvis Futures
        12. Sources and Supported Operating Systems
      4. vim—vi Improved
        1. Author and History
        2. Important Command-Line Arguments
        3. Online Help and Other Documentation
        4. Initialization
        5. Multiwindow Editing
        6. GUI Interfaces
        7. Extended Regular Expressions
        8. Improved Editing Facilities
        9. Programming Assistance
        10. Interesting Features
        11. Sources and Supported Operating Systems
      5. vile—vi Like Emacs
        1. Authors and History
        2. Important Command-Line Arguments
        3. Online Help and Other Documentation
        4. Initialization
        5. Multiwindow Editing
        6. GUI Interfaces
        7. Extended Regular Expressions
        8. Improved Editing Facilities
        9. Programming Assistance
        10. Interesting Features
        11. Sources and Supported Operating Systems
    6. Appendixes
      1. Quick Reference
      2. ex Commands
        1. Command Syntax
        2. Alphabetical List of Commands
      3. Setting Options
        1. Solaris 2.6 vi Options
        2. nvi 1.79 Options
        3. elvis 2.0 Options
        4. vim 5.1 Options
        5. vile 8.0 Options
      4. Problem Checklists
        1. Problems Opening Files
        2. Problems Saving Files
        3. Problems Getting to Visual Mode
        4. Problems with vi Commands
        5. Problems with Deletions
      5. vi and the Internet
        1. vi Web Sites
        2. Amaze Your Friends!
        3. Tastes Great, Less Filling
        4. vi Quotes
    7. Colophon
    8. Index