Learning the VI and VIM Editors

  • ISBN13:


  • ISBN10:


  • Edition: 7th
  • Format: Paperback
  • Copyright: 7/1/2008
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping On Orders Over $59!
    Your order must be $59 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $34.99 Save up to $5.25
  • Buy New


Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The eBook copy of this book is not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.


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.

Author Biography

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 mainframe JCL 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.

Table of Contents

Prefacep. xiii
Basic and Advanced vi
The vi Text Editorp. 3
A Brief Historical Perspectivep. 5
Opening and Closing Filesp. 6
Quitting Without Saving Editsp. 10
Simple Editingp. 13
vi Commandsp. 13
Moving the Cursorp. 14
Simple Editsp. 18
More Ways to Insert Textp. 30
Joining Two Lines with Jp. 31
Review of Basic vi Commandsp. 32
Moving Around in a Hurryp. 35
Movement by Screensp. 35
Movement by Text Blocksp. 38
Movement by Searchesp. 39
Movement by Line Numberp. 43
Review of vi Motion Commandsp. 44
Beyond the Basicsp. 47
More Command Combinationsp. 47
Options When Starting vip. 48
Making Use of Buffersp. 51
Marking Your Placep. 52
Other Advanced Editsp. 53
Review of vi Buffer and Marking Commandsp. 53
Introducing the ex Editorp. 55
ex Commandsp. 55
Editing with exp. 58
Saving and Exiting Filesp. 63
Copying a File into Another Filep. 65
Editing Multiple Filesp. 65
Global Replacementp. 71
Confirming Substitutionsp. 72
Context-Sensitive Replacementp. 73
Pattern-Matching Rulesp. 74
Pattern-Matching Examplesp. 81
A Final Look at Pattern Matchingp. 89
Advanced Editingp. 95
Customizing vip. 95
Executing Unix Commandsp. 99
Saving Commandsp. 103
Using ex Scriptsp. 114
Editing Program Source Codep. 120
Introduction to the vi Clonesp. 125
And These Are My Brothers, Darrell, Darrell, and Darrellp. 125
Multiwindow Editingp. 126
GUI Interfacesp. 127
Extended Regular Expressionsp. 128
Enhanced Tagsp. 129
Improved Facilitiesp. 134
Programming Assistancep. 138
Editor Comparison Summaryp. 140
Nothing Like the Originalp. 141
A Look Aheadp. 141
Vim (vi Improved): An Introductionp. 145
Overviewp. 146
Where to Get Vimp. 150
Getting Vim for Unix and GNU/Linuxp. 151
Getting Vim for Windows Environmentsp. 156
Getting Vim for the Macintosh Environmentp. 157
Other Operating Systemsp. 157
Aids and Easy Modes for New Usersp. 157
Summaryp. 158
Major Vim Improvements over vip. 159
Built-in Helpp. 159
Startup and Initialization Optionsp. 160
New Motion Commandsp. 167
Extended Regular Expressionsp. 169
Customizing the Executablep. 171
Multiple Windows in Vimp. 173
Initiating Multiwindow Editingp. 174
Opening Windowsp. 177
Moving Around Windows (Getting Your Cursor from Here to There)p. 180
Moving Windows Aroundp. 181
Resizing Windowsp. 183
Buffers and Their Interaction with Windowsp. 186
Playing Tag with Windowsp. 190
Tabbed Editingp. 191
Closing and Quitting Windowsp. 192
Summaryp. 193
Vim Scriptsp. 195
What's Your Favorite Color (Scheme)?p. 195
Dynamic File Type Configuration Through Scriptingp. 205
Some Additional Thoughts About Vim Scriptingp. 213
Resourcesp. 218
Graphical Vim (gvim)p. 219
General Introduction to gvimp. 220
Customizing Scrollbars, Menus, and Toolbarsp. 225
gvim in Microsoft Windowsp. 236
gvim in the X Window Systemp. 237
GUI Options and Command Synopsisp. 237
Vim Enhancements for Programmersp. 239
Folding and Outlining (Outline Mode)p. 240
Auto and Smart Indentingp. 251
Keyword and Dictionary Word Completionp. 259
Tag Stackingp. 268
Syntax Highlightingp. 270
Compiling and Checking Errors with Vimp. 279
Some Final Thoughts on Vim for Writing Programsp. 284
Other Cool Stuff in Vimp. 285
Editing Binary Filesp. 285
Digraphs: Non-ASCII Charactersp. 287
Editing Files in Other Placesp. 289
Navigating and Changing Directoriesp. 290
Backups with Vimp. 292
HTML Your Textp. 293
What's the Difference?p. 294
Undoing Undosp. 296
Now, Where Was I?p. 297
What's My Line (Size)?p. 300
Abbreviations of Vim Commands and Optionsp. 302
A Few Quickies (Not Necessarily Vim-Specific)p. 303
More Resourcesp. 304
Other vi Clones
nvi: New vip. 307
Author and Historyp. 307
Important Command-Line Argumentsp. 308
Online Help and Other Documentationp. 309
Initializationp. 309
Multiwindow Editingp. 310
GUI Interfacesp. 311
Extended Regular Expressionsp. 311
Improvements for Editingp. 312
Programming Assistancep. 315
Interesting Featuresp. 315
Sources and Supported Operating Systemsp. 315
Elvisp. 317
Author and Historyp. 317
Important Command-Line Argumentsp. 317
Online Help and Other Documentationp. 319
Initializationp. 319
Multiwindow Editingp. 320
GUI Interfacesp. 323
Extended Regular Expressionsp. 328
Improved Editing Facilitiesp. 328
Programming Assistancep. 332
Interesting Featuresp. 335
elvis Futuresp. 340
Sources and Supported Operating Systemsp. 340
vile: vi Like Emacsp. 343
Authors and Historyp. 343
Important Command-Line Argumentsp. 344
Online Help and Other Documentationp. 345
Initializationp. 346
Multiwindow Editingp. 347
GUI Interfacesp. 349
Extended Regular Expressionsp. 357
Improved Editing Facilitiesp. 359
Programming Assistancep. 365
Interesting Featuresp. 368
Sources and Supported Operating Systemsp. 374
The vi, ex, and Vim Editorsp. 377
Setting Optionsp. 415
Problem Checklistsp. 431
vi and the Internetp. 435
Indexp. 447
Table of Contents provided by Ingram. All Rights Reserved.

Rewards Program

Write a Review