Learning the vi and Vim Editors

( 1 )


There's nothing that hard-core Unix and Linux users are more fanatical about than their text editor. Editors are the subject of adoration and worship, or of scorn and ridicule, depending upon whether the topic of discussion is your editor or someone else's.

vi has been the standard editor for close to 30 years. Popular on Unix and Linux, it has a growing following on Windows systems, too. Most experienced system administrators cite vi as their ...

See more details below
Paperback (Seventh Edition)
BN.com price
(Save 32%)$34.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (13) from $17.95   
  • New (7) from $19.64   
  • Used (6) from $17.95   
Learning the vi and Vim Editors

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
BN.com price
(Save 44%)$27.99 List Price


There's nothing that hard-core Unix and Linux users are more fanatical about than their text editor. Editors are the subject of adoration and worship, or of scorn and ridicule, depending upon whether the topic of discussion is your editor or someone else's.

vi has been the standard editor for close to 30 years. Popular on Unix and Linux, it has a growing following on Windows systems, too. Most experienced system administrators cite vi as their tool of choice. And since 1986, this book has been the guide for vi.

However, Unix systems are not what they were 30 years ago, and neither is this book. While retaining all the valuable features of previous editions, the 7th edition of Learning the vi and vim Editors has been expanded to include detailed information on vim, the leading vi clone. vim is the default version of vi on most Linux systems and on Mac OS X, and is available for many other operating systems too.

With this guide, you learn text editing basics and advanced tools for both editors, such as multi-window editing, how to write both interactive macros and scripts to extend the editor, and power tools for programmers — all in the easy-to-follow style that has made this book a classic.

Learning the vi and vim Editors includes:

A complete introduction to text editing with vi:

  • How to move around vi in a hurry
  • Beyond the basics, such as using buffers
  • vi's global search and replacement
  • Advanced editing, including customizing vi and executing Unix commands

How to make full use of vim:

  • Extended text objects and more powerful regular expressions
  • Multi-window editing and powerful vim scripts
  • How to make full use of the GUI version of vim, called gvim
  • vim's enhancements for programmers, such as syntax highlighting, folding and extended tags

Coverage of three other popular vi clones — nvi, elvis, and vile — is also included. You'll find several valuable appendixes, including an alphabetical quick reference to both vi and ex mode commands for regular vi and for vim, plus an updated appendix on vi and the Internet.

Learning either vi or vim is required knowledge if you use Linux or Unix, and in either case, reading this book is essential. After reading this book, the choice of editor will be obvious for you too.

Read More Show Less

Product Details

  • ISBN-13: 9780596529833
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 7/22/2008
  • Series: Learning Series
  • Edition description: Seventh Edition
  • Edition number: 7
  • Pages: 494
  • Sales rank: 539,974
  • Product dimensions: 7.00 (w) x 9.10 (h) x 1.20 (d)

Meet the Author

Arnold Robbins, an Atlanta native, is a professional programmer and technical author. He has been working with Unix systems since 1980, when he was introduced to a PDP-11 running a version of Sixth Edition Unix. His experience also includes multiple commercial Unix systems, from Sun, IBM, HP and DEC. He has been working with GNU/Linux systems since 1996. He likes his Macintosh laptop, but it has been commandeered by one of his daughters.

Arnold has also been a heavy awk user since 1987, when he became involved with gawk, the GNU project's version of awk. As a member of the POSIX 1003.2 balloting group, he helped shape the POSIX standard for awk. He is currently the maintainer of gawk and its documentation.

O'Reilly has been keeping him busy: He is author and/or coauthor of the bestselling titles: Unix In A Nutshell, Effective awk Programming, sed & awk, Classic Shell Scripting, and several pocket references.

Elbert is a professional software engineer and software architect recently finishing a 21-year career in the telcom industry. He wrote a full screen editor in assembler in 1983 as his first professional assignment, and has had special interest in editors since. He loves connecting Unix to anything and once wrote a stream editor program to automate JCL edits for mainframe monthly configurations by streaming mainframeJCL to a stream editor on an RJE connected Unix box.

He loves tinkering with everything Unix and considers any environment incomplete without his suite of Unix work-alike tools and the latest version of vim. He is a Unix Shell specialist, writing entire applications with only the shell.

His telcom honored him with their highest award for money-saving applications that he authored using a set of mainframe screen-scraping tools he wrote himself. They continue to use those applications today. He was also one of three founding team members that brought web 1.0 to the corporate consciousness in his telco position, and his team featured on the cover of CIO Magazine for their innovative and pioneering works.

He also served a brief stint on the original Microsoft NT beta support team in 1992.

He loves bicycling, music, and reading. Today he lives in the Chicago area where he occasionally takes on short term projects and works on personal software products.

Linda Lamb is a former employee of O'Reilly Media, where she worked in various capacities, including technical writer, editor of technical books, and marketing manager. She also worked on O'Reilly's series of consumer health books, Patient Centered Guides.

Read More Show Less

Table of Contents

Scope of This Book;
How the Material Is Presented;
What You Need to Know Before Starting;
Comments and Questions;
Safari® Books Online;
About the Previous Editions;
Preface to the Seventh Edition;
Basic and Advanced vi;
Chapter 1: The vi Text Editor;
1.1 A Brief Historical Perspective;
1.2 Opening and Closing Files;
1.3 Quitting Without Saving Edits;
Chapter 2: Simple Editing;
2.1 vi Commands;
2.2 Moving the Cursor;
2.3 Simple Edits;
2.4 More Ways to Insert Text;
2.5 Joining Two Lines with J;
2.6 Review of Basic vi Commands;
Chapter 3: Moving Around in a Hurry;
3.1 Movement by Screens;
3.2 Movement by Text Blocks;
3.3 Movement by Searches;
3.4 Movement by Line Number;
3.5 Review of vi Motion Commands;
Chapter 4: Beyond the Basics;
4.1 More Command Combinations;
4.2 Options When Starting vi;
4.3 Making Use of Buffers;
4.4 Marking Your Place;
4.5 Other Advanced Edits;
4.6 Review of vi Buffer and Marking Commands;
Chapter 5: Introducing the ex Editor;
5.1 ex Commands;
5.2 Editing with ex;
5.3 Saving and Exiting Files;
5.4 Copying a File into Another File;
5.5 Editing Multiple Files;
Chapter 6: Global Replacement;
6.1 Confirming Substitutions;
6.2 Context-Sensitive Replacement;
6.3 Pattern-Matching Rules;
6.4 Pattern-Matching Examples;
6.5 A Final Look at Pattern Matching;
Chapter 7: Advanced Editing;
7.1 Customizing vi;
7.2 Executing Unix Commands;
7.3 Saving Commands;
7.4 Using ex Scripts;
7.5 Editing Program Source Code;
Chapter 8: Introduction to the vi Clones;
8.1 And These Are My Brothers, Darrell, Darrell, and Darrell;
8.2 Multiwindow Editing;
8.3 GUI Interfaces;
8.4 Extended Regular Expressions;
8.5 Enhanced Tags;
8.6 Improved Facilities;
8.7 Programming Assistance;
8.8 Editor Comparison Summary;
8.9 Nothing Like the Original;
8.10 A Look Ahead;
Chapter 9: Vim (vi Improved): An Introduction;
9.1 Overview;
9.2 Where to Get Vim;
9.3 Getting Vim for Unix and GNU/Linux;
9.4 Getting Vim for Windows Environments;
9.5 Getting Vim for the Macintosh Environment;
9.6 Other Operating Systems;
9.7 Aids and Easy Modes for New Users;
9.8 Summary;
Chapter 10: Major Vim Improvements over vi;
10.1 Built-in Help;
10.2 Startup and Initialization Options;
10.3 New Motion Commands;
10.4 Extended Regular Expressions;
10.5 Customizing the Executable;
Chapter 11: Multiple Windows in Vim;
11.1 Initiating Multiwindow Editing;
11.2 Opening Windows;
11.3 Moving Around Windows (Getting Your Cursor from Here to There);
11.4 Moving Windows Around;
11.5 Resizing Windows;
11.6 Buffers and Their Interaction with Windows;
11.7 Playing Tag with Windows;
11.8 Tabbed Editing;
11.9 Closing and Quitting Windows;
11.10 Summary;
Chapter 12: Vim Scripts;
12.1 What’s Your Favorite Color (Scheme)?;
12.2 Dynamic File Type Configuration Through Scripting;
12.3 Some Additional Thoughts About Vim Scripting;
12.4 Resources;
Chapter 13: Graphical Vim (gvim);
13.1 General Introduction to gvim;
13.2 Customizing Scrollbars, Menus, and Toolbars;
13.3 gvim in Microsoft Windows;
13.4 gvim in the X Window System;
13.5 GUI Options and Command Synopsis;
Chapter 14: Vim Enhancements for Programmers;
14.1 Folding and Outlining (Outline Mode);
14.2 Auto and Smart Indenting;
14.3 Keyword and Dictionary Word Completion;
14.4 Tag Stacking;
14.5 Syntax Highlighting;
14.6 Compiling and Checking Errors with Vim;
14.7 Some Final Thoughts on Vim for Writing Programs;
Chapter 15: Other Cool Stuff in Vim;
15.1 Editing Binary Files;
15.2 Digraphs: Non-ASCII Characters;
15.3 Editing Files in Other Places;
15.4 Navigating and Changing Directories;
15.5 Backups with Vim;
15.6 HTML Your Text;
15.7 What’s the Difference?;
15.8 Undoing Undos;
15.9 Now, Where Was I?;
15.10 What’s My Line (Size)?;
15.11 Abbreviations of Vim Commands and Options;
15.12 A Few Quickies (Not Necessarily Vim-Specific);
15.13 More Resources;
Other vi Clones;
Chapter 16: nvi: New vi;
16.1 Author and History;
16.2 Important Command-Line Arguments;
16.3 Online Help and Other Documentation;
16.4 Initialization;
16.5 Multiwindow Editing;
16.6 GUI Interfaces;
16.7 Extended Regular Expressions;
16.8 Improvements for Editing;
16.9 Programming Assistance;
16.10 Interesting Features;
16.11 Sources and Supported Operating Systems;
Chapter 17: Elvis;
17.1 Author and History;
17.2 Important Command-Line Arguments;
17.3 Online Help and Other Documentation;
17.4 Initialization;
17.5 Multiwindow Editing;
17.6 GUI Interfaces;
17.7 Extended Regular Expressions;
17.8 Improved Editing Facilities;
17.9 Programming Assistance;
17.10 Interesting Features;
17.11 elvis Futures;
17.12 Sources and Supported Operating Systems;
Chapter 18: vile: vi Like Emacs;
18.1 Authors and History;
18.2 Important Command-Line Arguments;
18.3 Online Help and Other Documentation;
18.4 Initialization;
18.5 Multiwindow Editing;
18.6 GUI Interfaces;
18.7 Extended Regular Expressions;
18.8 Improved Editing Facilities;
18.9 Programming Assistance;
18.10 Interesting Features;
18.11 Sources and Supported Operating Systems;
The vi, ex, and Vim Editors;
Command-Line Syntax;
Review of vi Operations;
vi Commands;
vi Configuration;
ex Basics;
Alphabetical Summary of ex Commands;
Setting Options;
Solaris vi Options;
nvi 1.79 Options;
elvis 2.2 Options;
Vim 7.1 Options;
vile 9.6 Options;
Problem Checklists;
Problems Opening Files;
Problems Saving Files;
Problems Getting to Visual Mode;
Problems with vi Commands;
Problems with Deletions;
vi and the Internet;
Where to Start;
vi Web Sites;
A Different vi Clone;
Amaze Your Friends!;
Tastes Great, Less Filling;
vi Quotes;

Read More Show Less

Customer Reviews

Average Rating 4
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted January 29, 2011

    No text was provided for this review.

Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)