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.
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.
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!
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.
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.
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
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.
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”.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.)
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.
Четох книгата диагонално и ми се стори изчерпателна. Бих искал да науча как точно vim вари кафе, но не можах. От останалите функции, оказа се, че знам почти всичко, което някога ми е трябвало и не знам ужасно много неща, за които нямах никакво желание или нужда да овладявам.
Принципно vim е хубаво да се владее, но отказвам да запомня повече от 1 начин да свърша нещо с него. Не си струва, поне за мен.
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
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.