Tag Archives: Vim

Vim function for correcting whitespace to WP standards

When doing client work, especially in a team, I like to urge adherence to the WordPress coding standards. This is especially important with whitespace, in particular when other members of the team have their IDEs set up in certain ways that frustrate the standards. I wrote this quick little functions for your .vimrc that does some whitespace cleanup in the currently open buffer. (I’m sure there are a thousand better ways to do it, and you should feel free to let me know in the comments. This is just what I put together in 15 minutes.)

I’ve mapped it to F8. Modify as you’d like.

For your keyboard health

It only took a few months of working full-time with computers for wrist fatigue to kick in. After a stretch of 10-12 hour days at the keyboard (at the time, it was the chiclet keyboard of a Macbook), my wrists would feel tight, and my fingers weak. I’d just quit my job working for the state to be a freelancer, and I began to panic that my body wouldn’t hold out!

So I made a couple of drastic adjustments to the way I work. The one that’s had the most general benefit has been my standing desk, which allows me to keep my eyes straight forward, and my forearms parallel to the ground. Aside from this, there are two other big changes I’ve made to my setup. These are directly related to the keyboard itself.

  1. Dvorak – August Dvorak, inventor of the Dvorak keyboard layout, famously quipped that a text that would require 12-20 miles of finger travel on a QWERTY keyboard would take just one mile on Dvorak. This is probably an exaggeration.. Still, it’s hard to deny that Dvorak has a lot of intuitive appeal: vowels appear in the home row of the left hand, the most common consonants in the home row of the left hand, and typing English words generally requires fewer row jumps and other ugliness.

    Switching to Dvorak was hard – far harder, in my experience, than switching to a standing desk, or to Linux, or even to Vim. For a few weeks, I spent an hour or two per day doing drills in Master Key. Then I switched to using Dvorak in the morning, until my brain would hurt so bad that I’d switch to QWERTY by around 10am. When I could finally make it until noon using Dvorak, I quit QWERTY altogether, as code switching between the layouts was proving more difficult than Dvorak itself.

    During the transition, I was a slow typist (30-40 WPM for prose around the time of the final switch, down from 90-100 on QWERTY). This affected my work efficiency. Worse still, the stress of hesitating the slightest bit before each key press was actually making my wrist fatigue worse than it was with QWERTY. But I persisted. After about six weeks using Dvorak full-time, I was up to maybe 60-70 WPM. (I’m since up to at least my pre-Dvorak speeds.) And, most importantly, I finally started to reap the ergonomic benefits of Dvorak. I’m able to type with far less wrist movement than before, with the result that I have much, much more stamina – those 10-12 hour days tire my brain way before they tire my fingers. Totally worth it.

    (Side note: A lot of people – people who are not touch-typists to begin with, I guess – put stickers on their keyboards to show the Dvorak layout, or even pop the keys off and rearrange them. I never did this. It forced me to learn the layout much more thoroughly. Plus, it is an order of magnitude more bad ass to type Dvorak on a QWERTY keyboard.)

  2. Kinesis Freestyle keyboard – I’d been typing for a long time on chiclet-style keyboards: first the Macbook, then the Macbook Pro, then an Apple USB keyboard. These keyboards are beautiful and quiet. But they don’t give much feedback. And touch-typing on them requires you to crook your wrists outward, in order to get your fingers resting on the home row. On the recommendation of my main man Marshall Sorenson, I bought myself a Kinesis Freestyle. It’s got nice, clicky keys. And it takes the idea of ergonomic keyboards to an extreme: the two halves of the keyboard are actually separate pieces, separated by an 8″ cable (a 20″ version is also available). Now I can keep the two halves positioned in such a way that I don’t have to bring my wrists too close together, and I don’t have to bend them at a funky angle to touch type.

    Kinesis Freestyle 2

    Kinesis Freestyle 2

    I love this keyboard so much that, now that I’ve switched away from the Mac, I’ve bought myself a new, non-Mac version of the Freestyle. (I just got it in the mail yesterday, prompting me to write this post.)

It takes a bit of work – and some risk – to make radical changes for the sake of ergonomics. But it’s an investment in the future. And don’t we all want to Win The Future?

Bonus! Buy my old keyboard

Needs a good home

Needs a good home

[EDIT 2012-10-03 – The keyboard has found a good home. Take good care of her, Will!]

I won’t be needing my much-loved Freestyle for Mac anymore. Wanna buy it? It’s in perfect working order, and I’ll clean it up real nice before sending it out to you. These puppies are $100 new (and, actually, it looks like they’re discontinued at the moment, until the Freestyle 2 for Mac comes out). I’ll be happy to let it go to a faithful reader of this blog for $50, continental US shipping included. (If you’re outside the contintental US, contact me first to ask about shipping.) If I don’t get any bites, I’ll put it on eBay, but I’d rather see it go to a friend. Leave a comment or drop me an email: boone /at/ gorg dot es.

Project Reclaim update

Back in March 2011, I kicked off the Project Reclaim project. Since then, others have picked up where I’ve left off – most notably, Doug Belshaw and D’Arcy Norman (who have surpassed me both in the reclaiming and in the blogging about the reclaiming). Behind my radio silence, though, has been a flurry of recent reclaiming activity:

  • I’m mostly de-Mac-ified. I recently bought a Samsung Series 9, which is serving as a stopgap full-time machine until I have the time to set up a desktop Linux rig. On day one, I wiped the Windows 7 installation and installed Arch Linux. It took some time to get set up, and I’m still using my Mac for a couple of things (Picasa, Skype, the old Adobe AIR Tweetdeck), but I’m almost totally moved over. I may write a post or two in the upcoming weeks about specific parts of the transition – there were some pain points, to be sure, especially in the initial setup. But, in general, it’s been smoother, easier, and more pleasurable than I would have guessed. Using Linux full time makes me feel like I’m back in the driver’s seat of my computing life, and it feels extra good to know that 95% of the software on my full-time machine is non-proprietary.
  • At the same time that I moved to Linux, I also switched to Vim. I’d been a user of BBEdit, which is a really great piece of software, but moving away from the Mac meant I had to choose something else. So I figured I’d go for the powerhouse of all text editors. Vim has a certain allure. When I was younger, I studied jazz piano. I remember watching my instructor play and being driven nearly to tears: I understood, in broad strokes, what he was doing and why it sounded the way it did, but it crushed me that I couldn’t translate that knowledge into the same kind of performance magic that he could. I feel much the same way about Vim masters. I’m far from a master, but I’m getting much much more fluent. Also, of course, Vim is non-proprietary, and it gives me major geek cred. So, big win all around. I should note that the Vim transition has actually been far more difficult than the Linux transition, and it was only after about four or five weeks of full-time use that I started to feel like I was back to my pre-switch level of productivity. (In this sense, it was a lot like switching from QWERTY to Dvorak.)

The big proprietary services and software products left in my life are Dropbox and Twitter. Moving away from Dropbox is fairly simple – see D’Arcy’s great posts on his experiments with Owncloud – I’ve just been lazy about it. Twitter is far more complicated, both technically and socially, as well as far more pressing, given Twitter’s recent NBCishness. So that’s the next mountain to climb.

How many others have been Reclaiming over the last year or two? Would love to see more projects along the lines of D’Arcy’s and Doug’s.