Vi IMproved -- Vim
Learning to crawl
Books describing editors generally fall into two categories. The first category of books will describe a particular function (like moving through a file) with all the known ways for performing that function, ad nauseum. The second category distills the myriad of ways to perform that function into a handful of the most common or most useful ways. Vi IMproved -- Vim combines both methods with good results.
The first section of the book is entitled Basic Editing; this section introduces the reader to starting and using Vim effectively without getting too bogged down in the gory details of Vim's vi heritage. In the chapter on moving around, the author begins with two methods of movement. In the details portion, the author has the reader performing more complex movements. This is a good approach, much like learning how to walk before learning how to hop, skip, jump, and dance through your document. Unfortunately this approach makes using this book as a reference very difficult. I would read sections that I wanted to use later, only to realize I couldn't find the section again. Vi IMproved -- Vim more than makes up for this shortcoming with a generous appendix detailing the Normal Mode, Command Mode, and Visual Mode commands along with a well-designed quick-reference section.
Made to Order
One of the strengths of Vim over other vi clones is Vim's ability to be used as a regular GUI application, and not just as an xterm-enhanced application.
Vi -- IMproved Vim shows not only how to use the GUI, but also how to customize the GUI to fit the reader's preferences. A good portion of this book deals with customizing Vim to suit the reader's style through the various parameters, menus, and GUI elements. Users who like their editors as stock as possible will find themselves skipping a lot of pages in this book. However even they will be tempted to try out some of the neat functions that pop up as they flip through the pages. The author conveys a sense of exploration, inviting users to experiment and try out new things with Vim.
Errata
Unfortunately, with vi and its clones, a single letter can mean the difference between moving through the document and deleting half of it by accident. Vi IMproved -- Vim is plagued with typos and errors, making this a difficult book for newbies to get into without having the errata sheet from http://vim.sf.net handy. It's understandable why a book like this would have some errors, especially with vi and Vim's terse keyboard commands.
Conclusion
Users of Vim will no doubt be thrilled with Vi IMproved -- Vim. Having a reference outside of the help menus in the program is a godsend for any user of Vim. Unfortunately the errors in this book mar what could have been the definitive book for Vim users, but for those who are starting out with Vim, or who would like to know more about Vim, this book is the perfect starting point and reference. The book covers the 5.x series of editors, but that shouldn't be a problem for most people looking to get started with the 6.x series.
If you're using Vim, you need Vi IMproved -- Vim.
You can purchase Vi IMproved from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Next: ls for dummies
Vi Improved
As opposed to those people who are too dumb to use proper grammar.
It's hard to take seriously a text editor named after a sink cleaning product.
Vim
-----
You get spoiled by it's features.
I use Vim on my Debian box at home, but I am stuck with standard vi on the Solaris boxes at work.
I really miss some of its features when I'm "stuck" with "vanilla" vi.
I'm afraid if I get this book I'll miss it even more.
Heffel
Expert Java EE Consulting
"Enron Biotech has discovered a gene which may explain the sharply divided preference in the hacker community between Vi and Emacs," said George Stefanscamoulus . "this may help us to utimately produce the perfect hacker". "Only we still haven't figured out which program is really the best. More R&D is needed."
[mandatory flaming response about how Vi/Vim 0wnz EMACS here] :)
--pi
A book written to guide the newbie through a prickley (powerful!!) editor and it's chock full of errors?? The whole point of purchasing on of these is to provide a leg up the learning curve.
Sorry, no sale.
(The authour probably uses emacs, or worse, Word.)
"Remember, any tool can be the right tool." -- Red Green
The errata sheet can actually be found here. The link in the story was only Vim's home page.
Rich
Although I am a die-hard emacs freek, on occasion I use one of those spiffy one-handed chording "keyboards", and I must say, vi *rocks* in that case.
Okay, that's all. Get back to your cubicles and your Nerf(tm) Mortar Launchers.
I think most people will find all the VI they need to know on the Vi reference card at vh224401.truman.edu
The obvious answer to that R&D is to ask Gene Hackman which he prefers.
He'll probably blow us all away and say something completely out of line. Like, "pico".
-Riskable
"Those who choose proprietary software will pay for their decision!"
his suggestion? mg - it's apparently "like emacs" except "without the bloat".
2 1337 4 u!
El riesgo vive siempre!
I hate vi (too weird) and emacs (weird, and bloated). Well, I should say I made a run at emacs once but never bought into the lifestyle so it was just too much overhead for simple edits.
I've instead been a longtime fan of joe. Simple, lightweight and powerful enough for more complicated jobs. AND it's user friendly.
Another wonderfully useful feature of VIM is that you can record useful, exacting macros with VIM, which you certainly can't do with MSVC or, in my relatively limited experiece, any other editor other than emacs. All the power of VIM's normal mode is present in its macro capability.
Another bonus of VIM is that it can simultaneously display many different files split horizontally or vertically. While MSVC will allow you to do this, the title bars and scroll bars in all of those windows eat up so much screen space that it's not worth doing for more than two files.
Also, the syntax highlighting in VIM is better, or at least more configurable. For example, I've been using doxygen lately. I really like the different elements of a doxygen comment to show up in different colors so that I can pick out easily when I've made a stupid mistake. For VIM, I just went to vim.sf.net, found the friendly doxygen.vim syntax highlighting fixeruper that someone had written and I was in business. With MSVC you could probably write some extension to highlight the syntax the way you wanted, but what a pain.
In the end it comes down to using a tool that is designed for the task. VIM was designed for editing code. The MSVC editor employs the same basic editing philosophy as notepad or MS Word, which were certainly never designed for coding. Just a simple example: VIM has a set of commands which work in a line oriented way. Software is written in lines. Honestly, a good deal of what I find myself doing with code is moving a line or a group of lines around.
Before I starting using VIM, I was the most efficient person I knew at editing code in MSVC because I had the keyboard commands down. Now that I use VIM, I really do edit code way faster, especially for any sort of repetitive task.
I use both at work, so if anyone knows how to do these vim things in MSVC, let me know.
1) Repeat the last command
2) Execute a command an arbitrary number of times
3) Folding
4) Non-overlapping windows of different files
That's all I can think of right now. I've really tried getting aquainted with MSVC, since it has our project management integrated. But when I need to do non-trivial code changes, using vim always, always is easier.
> Any Text Editor That Needs A Book is hopelessly
> broken.
I truly hate this philosophy of interface design. It's what gives us useless, dumbed-down GUIs and languages like COBOL. Requiring the slightest goddamned effort by the user can make everybody's life easier.
"Whatever happened to fair use?"
-- Duff-Man
I found this VI tutorial particularly easy to follow.
"Oppression and harassment is a small price to pay to live in the land of the free." -- Montgomery Burns.
Easy: I can't run the MSVC editor from an SSH session.
The thing is, for the MSVC editor, all the commands are "hidden" in menus you reach with the mouse, and the keyboard shortcuts associated with them. vi just has different shortcuts.
If you don't like vi, just use a different editor. Just use what you like best, like all of us do. I don't like vi, I use joe, jed, pico or emacs. Do I complain that vi sucks? No, because it doesn't. It just doesn't fit the way I do editing.
One shall speak only if what one has to say is more beautiful than silence
You may see the obtuseness of VI as part of the initiation; I see it as damage and route around it.
This is a common misconception among people who are unfamiliar with vi (that the people who use it know that it's hard to use, but use it anyway because they're stuck and the past and so that they can feel smug and superior to the Common Man who can only use Common Editors.) However, it's dead wrong.
I use vi because it's easy to use. That's right; vi is easy to use.
It is not, however, particularly easy to learn, and here's where the problems arise: too many people confuse ease of use with ease of learning. If you sit somebody down in front of a tool such as the MSVC++ editor, of course they will be able to learn it quicker than they would be able to learn vi, particularly if they are already familiar with concepts such as the mouse, pull-down menus, standard keyboard shortcuts, and other familiar elements of modern windowing environments.
But does that mean that, at the end of the day, the MSVC++ editor is easier to use than vi? I don't think so. For example, if I want to delete 8 lines of text in vi, I simply type "8dd". Now, you might say "Well, all I have to do is take the mouse, highlight those eight lines, and choose Edit->Cut or press Delete or Control-C or Control-X or whatever", and you'd be right. And this may be more intuitive and familiar then pressing "8dd", but you'd have a difficult time convincing me that it's easier, and it is most certainly not faster.
Here's the bottom line: Some vi users accuse users of other (mostly GUI) editors of being technically-challenged simpletons. Some users of other (mostly GUI) editors accuse vi users of being anachronistic elitists. Both sides are wrong. An editor is a tool; use the one that fits you the best. Personally, I'll take vi any day, but that is my opinion (and it is for this reason that I qualify my statement with "personally.")
We're going down, in a spiral to the ground