Slashdot Mirror


Vi IMproved -- Vim

Craig Maloney writes: "Bram Moolenaar's Vim editor has quickly become the clone of choice for users of the venerable vi editor. Unfortunately, until recently finding documentation for the features of Vim meant spending quality time with the help files that come with Vim. While the help files are very good, a manual/tutorial of the Vim editor was needed. Other vi books included scant pages about the improvements of Vim over standard vi, but Vim isn't only a slight improvement to vi. Vi IMproved -- Vim is the manual Vim users need to help them get the full benefit out of Vim." Read on for more of Craig's review of this book below. Vi IMproved -- Vim author Steve Oualline pages 572 publisher New Riders rating 7.5/10 reviewer Craig Maloney ISBN 0735710015 summary The first and only published book covering the basic and advanced usage of Vi IMproved.

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.

6 of 399 comments (clear)

  1. NO, VI 0WNZ EMACS by The+Pi-Guy · · Score: 3, Informative

    [mandatory flaming response about how Vi/Vim 0wnz EMACS here] :)
    --pi

  2. Correct errata sheet link by rjw57 · · Score: 5, Informative

    The errata sheet can actually be found here. The link in the story was only Vim's home page.

    --
    Rich
  3. All most people need on one page. by YoungHack · · Score: 3, Informative

    I think most people will find all the VI they need to know on the Vi reference card at vh224401.truman.edu

  4. Re:The only problem with Vim is... by Moritz+Moeller+-+Her · · Score: 3, Informative

    Just do :set compatible

    and you get all the masochistic vi feeling you need.

    --
    Moritz
  5. Re:Any Text Editor That Needs A Book... by leifw · · Score: 3, Informative
    One tremendously useful thing VIM can do that MSVC's editor can't is to use .tags files produced by ctags. Which MSVC has it's own ctags like feature which can be enabled with the "generate browse info" option, this info can not be produced if the code won't completely compile. ctags does not have that limitation, which is a significant advantage when you're trying to navigate through undocumented code that won't compile.

    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.

  6. Re:The only problem with Vim is... by ffatTony · · Score: 4, Informative

    There is nothing about Vim that anyone here uses that isn't part of vi.

    My favorites:

    • multi-level undo
    • expandtab - I don't need messy tabs in my code
    • syntax hilighting! hooray for anything that makes my day a little less dreary.
    • thesarus and spellcheck options
    • word/line completion/duplication
    • Amazing community - they've even got trivia questions on the sf website
    • editable command line
    • browsable Command line history
    • A big plus for me is that arrow keys function correctly. You may laugh, but the version of HPUX vi I used at my old job didn't do this
    • I also like the fact they're aren't too many cntrl-X combinations
    • acceptable start up time
    • good memory footprint
    • Less buggy than real vi's I've used, e.g. it doesn't appear to have a max-line length or max file size, doesn't crash by itself and send me an annoying email message about it
    • it reminds me if a recovery file is out there for the file I'm working on
    • warns me when the file has changed due to outside sources
    • children in Uganda

    This is why I like vim, but I also like emacs. People say I'm a little weird.