I spend a lot of time in front of a computer and have been getting frustrated at my lack of speed when navigating and typing. I started improving things a couple of months ago and thought it would be useful to write about the key changes I’ve made.
For some reason I never bothered with keyboard shortcuts. Copy and paste were the only ones in my muscle memory. Here are some shortcuts I now use regularly:
cmd + tabswitch apps
cmd + backtickswitch to a different instance of the same app
cmd + qquit current app
cmd + wclose current window
cmd + option + hclose all windows except the current one
cmd + lgives focus to url bar
cmd + tto open a new tab in
ctrl + tabselect next tab
ctrl + shift + tabselect previous tab
cmd + wclose current tab
Some of my most useful shortcuts are provided by apps. I use:
- SizeUp, which provides keyboard shortcuts for window management.
- Alfred, a highly customisable replacement for Spotlight. I use it for loading and switching apps, quick calculations, checking the weather and the odd google search. I feel like I’m only scratching the surface of what Alfred can do.
- Dash, a snippet manager and documentation browser which helps me avoid the black hole that is stackoverflow.
Within a few weeks I reached a decent speed, but then started feeling pain in my hands and wrists. I took a break for a while, improved my posture and even bought an ergonomic keyboard, but the pain persisted.
Dvorak keyboard layout
After a bit of research I discovered touch typing with Qwerty can cause hand pain. Qwerty was originally designed to keep typewriter keys from jamming—by spreading commonly used letters far apart. This was good for typewriters but not so good for hands.
I eventually decided to learn Programmer Dvorak. The Dvorak layout places the most common English characters on the home row, reducing the stress on hands.
Learning a new layout is frustrating—especially when you go cold turkey. The first week was a write-off in terms of productivity. I’ve been learning for four weeks now and can type at a bearable speed of ~30 words per minute. I doubt Dvorak is faster than Qwerty but it is certainly more comfortable. The pain in my hands has gone now too.
- On the Dvorak keyboard layout
- The Dvorak Zine
- Dvorak keyboard users – an interesting collection of Dvorak users’ experiences.
- Dvorak keyboard training
- Handling Repetitive Strain Injury
The command line
Having played with Linux a fair bit I have seen many arguments for using the command line over a graphical user interface. The main argument is that you can get things done faster with commands.
In a GUI you have to use the mouse, find the right icon, figure out how to use a menu, and deal with inconsistent designs. These annoyances aren’t always noticeable but the cumulative effect is wasted time.
I decided to get into to the command line by ditching my GUI development tools. I have replaced CodeKit with Gulp, which compiles and minifies my Sass, and refreshes the browser with live-reload. Sublime Text has been replaced with Vim.
I have found CLI tools to be cheaper (free), more flexible and more regularly updated than GUI alternatives. I can now share my setup across computers by sticking my dotfiles on Github. I no longer have to worry about license fees and Mac-only software.
- Treehouse have a good article on command line basics on their blog and a more in depth course which I recommend.
- Dan Benjamin had a great video tutorial called Meet the Command Line which no longer appears to exist. Andy Taylor did a great job of summarising it in his post UNIX Command Line Usage Notes.
Vim text editor
If you write code for a living, learning your text editor well is a good idea. I used the excellent Sublime Text 2 for a while before switching to Vim.
Vim is a text editor driven completely by keyboard commands (known as key bindings). It allows you to manipulate text with commands. Once you learn basic commands you can start combining them:
G20 is go to line 20 and
d2w is delete two words. The best article I have read on this is Learn to speak vim – verbs, nouns, and modifiers! by Yan Pritzker.
Learning Vim initially slowed me down, but it has been worth the sacrifice. It reminds me of the classic article Teach yourself programming in Ten Years. The web industry is often distracted by the new and shiny—but I’m excited to be using a text editor older than myself, which was developed on this terminal.
- Getting started with Vim
- Learn Vim progressively
- Vim Tutorials
- Everyone who tried to convince me to use Vim was wrong
- Vim Adventures - a game which teaches you Vim commands.
- Vim London talks
- How to learn Vim
- Common Vim commands
- Vim reference card
Markdown is a wonderfully simple syntax which allows documents to be written plain text, and then converted to html. I avoided learning it for a long time, thinking it would be difficult to pick up. I needed to learn it after switching my blog to Jekyll and was surprised that the main syntax took around 10 minutes to memorise. I can now write posts on any device and publish via Git. If you know html or write frequently you’ll love Markdown.
It has been fun learning some new tricks, it feels a bit like playing a video game. The challenge has made my work even more enjoyable (aside from that first week of Dvorak typing). I don’t feel particularly fast at anything at the moment but I am improving every day. I’m especially looking forward to typing and editing text at the speed of thought.