Vi IMproved--Vim and Happy Hacking Keyboard Lite 2
When you type vi on most Linux boxes, you're likely to get Vim. This is a good thing, but until now nobody has written a book that covers the features Vim has over vi.
Steve Oualline to the rescue. Some readers wrote in to say that Steve changed their lives with his article "That's Vimprovement! A Better vi" in our February issue. It's wonderful to be a part of bringing such a wonderful transformation to you people, and Steve's new book brings even more Vim knowledge to the masses.
Thank the book gods that it didn't come bundled with a CD-ROM. I hope this is a trend--book publishers should stop including software that will probably be obsolete for most of the book's shelf life. If this book should be bundled with anything, it's the new Happy Hacking Keyboard Lite 2 from PFU America. We used the QWERTY version, but there are also Dvorak and Japanese versions.
Vim enhances the original vi so you can edit faster, but the Happy Hacking series of keyboards removes features to achieve the same goal. There's no top row of function keys or anything right of Enter. Escape moves down to just left of the number one, which is why we're mentioning this keyboard in an review of a book about Vim--there'll be no more "Mom, can you make me some sandwiches? I'm going to go hit Escape today, be back for dinner." The missing keys are available with Fn, so you can still do a SysRq if you need to.
The Control key is where it belongs, above the left Shift. And the upper right corner is a little changed from a standard PC keyboard too. A DIP-switchable backspace/delete key is above Enter, and backslash/pipe and tilde/backquote are above that.
The Happy Hacking Keyboard Lite 2 adds cursor keys in an inverted T below the right Shift key. Fans of the original Happy Hacking Keyboard, which Linux Journal reviewed in 1998, will notice one other change--there's now a second Fn key on the left, so you can use both Fn and the left "diamond" (no Windows logo, but it acts like it) key.
Speaking of Fn keys, Fn works flawlessly with any other combination of modifiers, so if you have enough fingers you can still switch virtual consoles. Three-key combinations like Ctrl-Alt-F1 become four-key combinations like Ctrl-Alt-Fn-1. Set your fireworks on the ground before you light them and you should be OK.
How well does it work? The small size and small lip on the front increase the perceived height--because it's smaller, it feels thicker. If you use a wrist rest you might want to experiment with different ones. The key feel doesn't have the classic feel of increased resistance, then a spring click, then less resistance, as in an old IBM keyboard. The keys aren't completely mushy like a cheap PC keyboard, though. The closest I can come to describing the feel is that it's like a high-quality laptop keyboard but with much longer key travel.
The big question of course is can you use the Happy Hacking Keyboard and switch back to a regular keyboard for occasional edits without going insane? In my experience, yes.
Until your Happy Hacking Keyboard comes, if you're using a regular keyboard with Vim, you might want to stick "imap <F1> <esc>" in your .vimrc, to keep from hitting F1 for help when all you want to do is hit escape.
That brings us to the subject of .vimrc files. Do a Google search for "my .vimrc" and you will get hundreds of them--all full of productivity-maximizing, carpal-tunnel-saving goodness. Or, depending on your point of view, productivity-sucking days of tweaking your .vimrc just right so that when you do write something it will be really easy to do.
Even if you visit vim.org daily and are always working on your .virmrc to incorporate stuff you get off the Net, Steve's book makes a great command reference. One nice touch is that the reference appendices, which list commands in alphabetical order, include page numbers for those commands that are explained in detail in the body of the book.
If you're new to Vim, or to vi-like editors in general, the tutorial at the beginning of the book looks good and quickly transitions from a basic survival guide to true power editing. For basic wrist health reasons, it's a good idea to pick up as much text editing skill as possible, and carrying around a copy of this book is a great way to do it. If you just know enough vi to get by, you're leaving all the power of Vim on the table and needlessly trashing your wrists.
For example, if you've ever had unexpected results when pasting text into Vim from an X application, then :set paste will make the pasted-in text come out a lot closer to the original than it might otherwise. Commands and configuration settings abound.
There's also a detailed "Cookbook" chapter where you can find recipes for dealing with a lot of common editing tasks. Except where he has to, Steve keeps everything organized in short sections that you can read and apply quickly. The state of my .vimrc is much improved since the day I picked up this book.
As you might expect from the author of Practical C Programming, there is a lot of good information on how to customize Vim to handle C and other programming languages. Steve covers indentation, syntax highlighting and automatically dealing with make and the compiler in great detail. For example, you can insert a "modeline" in a file to enforce your tab settings even when someone with a differently configured Vim edits it. And Vim will run make for you, then automatically open any files with errors for editing.
There are no entries in the index for "mail" or "e-mail" and little information about how to use Vim for nonprogramming tasks like dealing with quoted text in e-mail. If you're searching for customization tweaks to make Vim do what you want as a mail editor, you might have to wait for a good book on Mutt.
There's excellent coverage of Vim's own built-in scripting language, but no examples of using Python or Perl, with which Vim can be integrated.
At no point does this book bother to say anything about which features are found in the original vi and which are Vim innovations. If you learn Vim, then log in to some legacy UNIX box, you'd better grab a copy of Vim. Fortunately, Vim is insanely portable, even to non-UNIX-like OSes, and there's an appendix that covers installation. So if you're spoiled by Vim and can never go back to regular vi, there's still hope for you.
Don Marti is the technical editor for Linux Journal. He can be reached at dmarti@ssc.com.
email: ljeditors@ssc.com
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- RSS Feeds
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Designing Electronics with Linux
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- What's the tweeting protocol?
- Kernel Problem
2 hours 52 min ago - BASH script to log IPs on public web server
7 hours 19 min ago - DynDNS
10 hours 55 min ago - Reply to comment | Linux Journal
11 hours 27 min ago - All the articles you talked
13 hours 51 min ago - All the articles you talked
13 hours 54 min ago - All the articles you talked
13 hours 55 min ago - myip
18 hours 20 min ago - Keeping track of IP address
20 hours 11 min ago - Roll your own dynamic dns
1 day 1 hour ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Re: Vi IMproved--Vim and Happy Hacking Keyboard Lite 2
What a screamingly useless review. I'd like some info on the pros and cons of the book.
Yes, I do have a first version HHK. Yes, I'm interested in the second version. But I'd like more of the reviewer's opinions on the Vim book please.
Re: Vi IMproved--Vim and Happy Hacking Keyboard Lite 2
That .vimrc command to map F1 to Esc should be:
imap
that is
imap F1 esc
with angle brackets around the F1 and the esc.
"Typing .vimrc commands in HTML is hard!" -- Web Barbie
Re: Vi IMproved--Vim and Happy Hacking Keyboard Lite 2
Ty this:
imap <F1> <esc>
-- Web Ken