Jump to ratings and reviews
Rate this book

Learning the vi and Vim Editors: Text Processing at Maximum Speed and Power

Rate this book
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

A complete introduction to text editing with

How to make full use of

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.

492 pages, Paperback

First published February 1, 1986

145 people are currently reading
668 people want to read

About the author

Arnold Robbins

38 books18 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
205 (30%)
4 stars
257 (38%)
3 stars
170 (25%)
2 stars
37 (5%)
1 star
2 (<1%)
Displaying 1 - 30 of 54 reviews
Profile Image for Den Ponsky.
7 reviews9 followers
October 28, 2019
Great principles, pretty well described. Highly recommended, especially the first part and the principles.
Profile Image for Farjam.
34 reviews3 followers
May 31, 2023
According to the author, part I of this book is designed to get you started using vi and Vim quickly. I never used the word "quickly" to describe this book. More accurate adjectives are in-depth, comprehensive, and detailed. So be patient with this book and learning vi in general because the learning curve is steep. When this degree of detail is paired with the weirdness ratio of vi functionality, it is pretty easy to become bored; thus, if you are new to vi, I recommend using a different text. "Mastering Vim Quickly" by Jovica Ilic is a beautiful place to start. This book is a wonderful place to finish and is geared towards folks who already love vi and want to learn everything there is to know about it or maybe use it as a reference.

Part I covers the functionality of all vi variants, and parts 2 and 3 focus mainly on advanced Vim features. Appendices A–D are excellent bonuses. They cover commands, syntaxes, macros etc. Overall, I suggest you read it if you are an enthusiastic vi user and want to learn more about it.



.
Profile Image for David.
Author 1 book120 followers
November 24, 2012
I can finally use Vi without making a fool of myself!

Vi is easily the least user-friendly application still in widespread use. Learn it well enough to feel confident when it pops up on the screen is something that requires a fair bit of devoted practice. It requires muscle memory.

The edition of this book that I read dates to the early 1990's - I don't believe Vim even existed then. Despite being so old, it was adequately suited to my needs: learning the basic commands of Vi which will be available on every POSIX-compatible system in the universe.

The book follows a logical path to learning the basics of the editor: first you learning how to open and close Vi, then how to move around, and finally, how to edit files and save them. There are plenty of troubleshooting tips, though most of these seemed like fairly unlikely things to encounter in modern times (oddball terminal settings and such).

There are well chosen exercises for most of the commands, and these will get you started. However, to really commit them to memory, I highly recommend that you put them into practice while attempting to edit a much larger document. In fact, I highly recommend my own method: I created a tutorial text file which guided an imaginary student through all of the Vi commands - with exercises and test areas for each. I even created a maze to help ingrain the h,j,k,l navigation commands. Doing this forced me to learn each command to a degree that I would not have had I just read this book and followed along with the provided exercises. Plus, using Vi to create the tutorial text file meant that I was not only learning but also using the commands. It's one thing to learn that 'A' takes you to the end of the line and puts you into insert mode. But it's entirely another to instantly fall in love with the command because you're tired of typing "llll...lllli" to do the same thing!

You'll actually exhaust Vi's repertoire of commands in the first fifty pages of this book. The rest of the book is concerned with commands for the "ex" line editor (for which Vi is merely a "visual" wrapper) and various tricks involving invocations of the Unix shell from ex. Vi is extremely lightweight (which is why it's so ubiquitous) and it becomes very clear in the last 2/3rds of Learning the vi editor that most of Vi's power actually comes from "outside" the editor itself in the standard set of Unix tools available from the command line.

The appendices are exceptionally helpful. Appendix A is a command Quick Reference. B lists all of the standard environment options (several of which you will absolutely change if you plan to do any programming in an unconfigured Vi). Appendix C has all of the ex commands, which is good to have because I imagine only a very, very serious Vi user will have memorized more than a fraction of these. Appendix D lists more troubleshooting and again, I think many of these problems may be outdated - however, if you're using Vi precisely because you're on an old or strange or minimalistic system, these may be exactly the sort of problems you'd run into!

I do recommend this book to learn Vi. It's a valuable skill if you find yourself in a Unix terminal on a semi-regular basis. Beyond the book, though, you'll almost certainly have to devote some time to working with Vi until you've achieved confidence with the editor. Make a tutorial. Challenge a friend or loved one to try to learn Vi from it. Happy editing!
Profile Image for James.
Author 14 books99 followers
July 27, 2017
Very useful! As a Linux novice I'm finding that most of what I've learned over the years about Windows systems doesn't translate, and Linux is not particularly intuitive to work with.
vi and Vim are versions of a widely used Linux text editor; after searching through several online references, I am finding this book very useful in the process of building my first Linux website/server. I recommend this as a reference for anyone in this position.
Profile Image for Matt.
Author 1 book25 followers
June 1, 2014
I think you finally get your official developer card when you learn Vim or Emacs.
10 reviews
October 16, 2017
A decent compendium of information about vi(m).

First let me mention that I (generally) use Vim keybindings from within an IDE, although for text files and (sometimes) simpler projects I will use Vim directly. I have little want to turn Vim into an IDE. I also am entirely uninterested in the other vi clones, and I completely skipped reading this part of the book. I'm also not a neophyte when it comes to Vim, but my knowledge is haphazard and has a lot of gaps.

From my perspective, the most useful chapters were probably 5, 6, and 7. There are a number of ex commands that I'd never learned, and picking these up were quite useful. Context-sensitive substitution was also something that I'd managed to completely miss, which is an extremely useful tool.

For Vim, chapter 11 on multiple windows was useful. Chapter 13, which shows an example of some of the customisation you can do with Graphical Vim and menus is interesting if nothing else, although I highly doubt I'll ever use it.

The appendices are nice to have around for those commands that you don't use often and haven't built muscle-memory for, and is a good reason to keep the book lying around.

All in all, this is a decent book that filled in a number of gaps for me, however, it's doubtful you'll want to read the entire thing.
Profile Image for Bernie4444.
2,465 reviews11 followers
December 22, 2022
This book covers vi, nvi, elvis, vim, and vile

vi (visual) is probably one of the most flexible editors (notice it is an editor, not a word processor) that one can use. There are several ways to accomplish the same common tasks. There are so many ways in fact that most people learn just a subset of commands and string them together to do their editing instead of learning the more exotic commands.

The advantage of an editor besides speed and simplicity is that you will not inadvertently place visually hidden code in the program as you can easily do with a word processor.

People got so used to these editors in dos-based environments. You can still use the command line editor after the colon at the foot of the screen. When you find and use the abilities of vi you will wonder what you did without it.

This book is a great starting place and you may never need another.

The Topics 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 vi clones’ extensions
- The nvi, elvis, vim, and vile editors
- Summary of vi and ex commands
- Vi and the internet

The examples are quite clear and plentiful.

Profile Image for Justin Cramer.
88 reviews2 followers
July 2, 2017
Though this book is ancient in Internet years I recommend it to anyone that really wants to dig deep into computers. Any time you touch a Unix-like environment (that includes Linux) vi, or more accurately vim, will be installed. Understanding few simple, yet highly unintuitive, commands can make you functional when reading and manipulate files like INIs, Logs, etc.

I will read this book again in two to three years, and maybe pull it off the shelf in the interim to look up a command or two.
Profile Image for Reinis Bekeris.
32 reviews1 follower
January 23, 2021
Really nice walkthrough from entering Vim to turning it in an IDE. I can’t say that after reading this book I can edit with VIM as fast as I can with VSCode, but it certainly showed how that can yield time savings after some more practice.
Book itself was easy to read and explained even the most complex examples in “human-terms”.
Profile Image for Joe Reddington.
Author 3 books5 followers
March 9, 2022
Learned a number of new things - and was really interesting to see it presented in a different way than ‘modern’ vi(m) texts. But spent a lot of time flicking through bits I already new. Mostly good for how much it foregrounded the ‘ed’ stuff.
227 reviews1 follower
December 29, 2018
Nic specjalnego. Polecam osobom zaczynającym zabawę z Vi i jego klonami.
Profile Image for Maggie.
5 reviews
August 19, 2019
Loved it. Quick read and full of goodness on every page.
Profile Image for wyclif.
189 reviews
September 9, 2020
Essential reference if you use vi, Vim, Neovim, or any of the family of vi clones and forks for editing on a UNIX, Linux, or macOS system.
Profile Image for Paul Pryce.
382 reviews
August 20, 2023
I started using vi in 1985 at Polytechnic and I nearly gave up the course there and then. I wish I’d had this book. It’s clear and easy to use. Maybe a sentimental 5-* vote but worth it.
Profile Image for Dmitriy.
73 reviews1 follower
July 8, 2017
Still wondering, why the author never mentioned ZQ command...
Profile Image for Eric.
722 reviews6 followers
August 28, 2018
Vim makes me feel like a bad ass hacker.
Profile Image for João Bruno.
6 reviews2 followers
March 3, 2017
Some of the examples were perhaps not very useful (the author focuses a lot on troff, which might not be the sort of thing most of his audience is familiar with) but this a good book on vi and vim, with some historical context on the vi editor that's interesting to read.
95 reviews
February 23, 2017
I actually have the older edition that predates vim. It's useful in the sense that some ancient servers still only run vim, I guess. But these days there are also online interactive adventure games that teach vi as well that aren't as dry.
Profile Image for Paul.
439 reviews7 followers
December 10, 2012
The danger is reviewing this book is that it’ll look as if I’m taking sides in the vi versus emacs wars. I use both, tending toward vi for line-oriented configuration files and program code, and toward emacs for paragraph-oriented text and XML files.

vi and its numerous clones are classic examples of a standard old-time Unix philosophy: “Why be clear when you can be efficient?” I’ll admit that I’m a fan of the efficient-over-easy approach, but it’s not without shortcomings. In particular, it’s easy to forget the terse, efficient commands that you don’t use frequently.

While I won’t make the claim that Learning the vi Editor will make vi easy to use for the uninitiated—even the simple act of navigating text requires (and gets) a chapter unto itself—I will say that it makes vi a much more powerful tool for people who use vi on a regular basis.

The authors have made the reasonable assumption that few people today use the original UNIX vi. Linux distributions, in particular, tend to include a vi clone like vim or nvi. (The exception is Gentoo, which stubbornly refuses to make any vi part of the base installation, relying instead on the woefully underpowered nano.) Since the vi clones each provide a superset of standard vi capabilities, the book includes chapters on four popular clones and the features they offer.

This is a book that stays near my workstation so that help is nearby. Recently, for example, I wanted to import a sendmail genericstable file into an aliases file. The trick is that the format for the two files is subtly different, requiring some text replacement during the import. It turned out to be quite possible, using vi to invoke grep piped into sed before inserting the text. I might have flailed around for some time had the book not been around to assist me to concoct the right recipe:

:$r !grep '^[[:alnum:]]' genericstable | sed 's/\t\+/: /'


Ugly? Yeah. Efficient and scriptable? Yep. And that’s that point.
16 reviews
December 25, 2013
I usually use gedit in Linux and other editors for Windows. I had used ViM as secondary option.

Used to see the quotes from hard-core Vi users saying that all other editors are make us lazy. I got a chance to feel that when I was used one of the non-GUI based Linux server. Though, there are many cheat-sheets and books available to know the vi commands, this book is special. If you are in a hurry, you may reluctant to read 494 pages solely for a text editor. But this is one time investment really worth for anything. As a main stream .NET developer, I started using VsViM in Visual Studio after learnt the power of Vi.

There are two primary parts in this book. Basic and advanced Vi and ex editor in first part. The second part covers Vim. The third part introduces some vi clones that I just skipped.

The introductory chapter describes historical perspective starts with TERM about which terminal you to use. Do you know why vi included support for recovering files as its integral part? During that time Unix systems were less stable. Interesting!!

I don't know we will really meet some of the worst case scenario like disk full, but explained in detail.

Chapter 2 in first part is the heart of whole book. The way it is described will make you comfortable to use commands instead of simply force us to memorize them. Nice cheat sheet at the end of chapter.

In Chapter 3, moving between screens are explained. Chapter 4 explains beyond basics that contains nice tips like read-only mode, bookmarking and some advance edits. This would help for people who use Vi for all kind of texts.

Chapter 5 explains the ex editor commands. Well organized.

Chapter 6 is very much important for hard-core developers that explains pattern-matching rules for 'replacing' text. Simply awesome.

I recommend this book for people who has time and want to use Vi's power in their day to day programming.
Profile Image for Sandy Maguire.
Author 3 books198 followers
July 26, 2015
Definitely showing its age; the first third of the book exclusively discusses vi (not vim), to the extent that a lot of it becomes superceded by the rest of the book. The author has a serious hard-on for `troff`, one in three examples of how to do things with vi(m) is "how to format for troff", which doesn't help the relevancy issue.

Because I was reading on an ebook, the other egregious problem was a huge chunk of the book devoted to vile, kyle, elvis, and other weird vi-clones, none of which really seem to exist anymore. It's really hard to skim on an ebook, which is why I mention this.

BUT after you've got past all my nitpicking, the book is pretty good. If you're already an advanced vim-user, you probably won't get much out of it, but it's worth a skim to see if you're missing any fundamentals. I'd highly suggest the chapter on ex-commands, even if you don't look at the rest of book; I finished the book this morning and have already found a use for them.

I wanted to recommend this book, but honestly you'd probably do better just searching for vim blog posts.
Profile Image for Jaroslav Tuček.
Author 1 book3 followers
November 15, 2015
Another great book from O'Reilly. The text has something to offer no matter whether you are a complete beginner or a seasoned vi veteran. I've been using the editor for years yet found many illuminating explanations of topics I never really took the time to master, like ex commands or vim tabs. I am also grateful to the authors for suggesting many nifty command combinations I haven't been aware of - I know I am a more proficient typist now thanks to reading the book.

The writing is clear and often humorous (that is, if you are into the geeky, Unix type of humor) and there is good progression from fundamental towards advanced topics. I only wish the authors did not waste so many pages on the other vi clones (which I had no desire to learn about, but your objectives may vary) and focused instead on some of the more involved parts of vi/vim, eg. scripting.
Profile Image for Greg.
70 reviews80 followers
Want to read
November 28, 2007
I've been working on this book slowly and surely for awhile.

I'm ultimately not going to finish it, as I really don't use vi, I use vim, and find the expansions offered by vim (too many to list) insanely useful, especially with my limited experience re: the macros.

I'm not a pro, but as I get increasingly interested in working with increasingly outdated/limited workstations, software such as vim regularly amazes me in its capacity for working quickly without . . .

I don't feel like starting an editor war. I like vi and vim. This book is, as far as I can tell, an excellent introduction, though probably best replaced by a good guide to vim.

If someone has a recommendation (is O'Reilly the best for that as well?) please pass it along.
Profile Image for Elhannah.
1 review1 follower
December 6, 2009
Not really here to review as much as to point out a minor correction to the listed authors. Being as the only new material in this edition is about vim (which doubled the original size of the book -- seven new chapters), and being as the reviews here kind of focus on the added value of the new vim chapters I thought I'd also add that I am the author of the new material of this edition. It'd be nice to see my name included as "author". I'm just saying.

-Elbert Hannah

(oh yeah, I give it five stars ... it actually is a decent vim primer across many feature sets.)
Profile Image for James Pyles.
Author 84 books6 followers
January 28, 2009
I needed to revitalize my atrophied vi/Vim skills and this book seemed like the logical answer. I stopped off at the vi chapters just long enough to remind myself of the basic commands and then launched into the Vim related chapters (it's called "vi Improved" for a reason). I highly recommend this book if you are new to vi/Vim or need to brush up on your skills. It's also a great reference text if you've mastered the basics but want to go more in depth.
Profile Image for Veselin Nikolov.
731 reviews87 followers
September 4, 2010
Четох книгата диагонално и ми се стори изчерпателна. Бих искал да науча как точно vim вари кафе, но не можах. От останалите функции, оказа се, че знам почти всичко, което някога ми е трябвало и не знам ужасно много неща, за които нямах никакво желание или нужда да овладявам.

Принципно vim е хубаво да се владее, но отказвам да запомня повече от 1 начин да свърша нещо с него. Не си струва, поне за мен.
Profile Image for Joe.
12 reviews2 followers
January 23, 2013
I used to hate vi because I was used to powerful ide's like eclipse but after reading this book I learned a lot of the luxuries of using vim and now I don't hesitate to use it at work for code changes. I feel a lot more comfortable using it and the book makes for a good reference. Only bad part is that i didn't feel the need for it to go into so many other editors like emacs and Elvis but I just skipped those sections
Profile Image for Pete.
5 reviews
February 10, 2008
vi has two modes: the one where it beeps alot and the one where it screws up your document. If you thought that was funny, you should get this book.

I always learn some new bit of vim arcana when I pick this up again, which has happened at least 10 times since I've owned it. I bought this back when I was a linux noob, and it still has things to teach me.
Displaying 1 - 30 of 54 reviews

Can't find what you're looking for?

Get help and learn more about the design.