By josh / May 21, 2014

Who else hates using their mouse?

Remember that scene in Princess Bride?

The lithe swordsman unsheathes his weapon and says, not for the last time:

“Hello. My name is Inigo Montoya. You killed my father. Prepare to die.”

That about sums up how I feel about my mouse.

(And don’t even get me started about trackpads …)

One of the best investments I’ve ever made in terms of reducing my need to use the mouse is spending some time learning Vim-style keyboard shortcuts.

If you’ve never used Vim, it’s definitely a unique beast because of its unusual concept of editing modes. Depending on what mode you’re in, a given key on the keyboard will work differently.

In most text editors, pressing the J key does one thing–it inserts the letter j in your text.

In Vim, the J key will insert a j, but only if you’re in insert mode. If you’re in normal mode (navigation mode), J works like the down arrow, moving the cursor down a line. Similarly, K emulates the up arrow. (If you’ve ever used Gmail’s keyboard shortcuts, you might be familiar with this idea already–Gmail got it from Vim.)

This idea of modal shortcuts is a bit hard to wrap your brain around at first, but it provides incredible efficiency once you master it.

When you’re coding or writing, you spend a lot of time navigating–often you’ll spend more time navigating than you spend actually typing new text. Modal shortcuts allow you to navigate efficiently without moving your fingers from the home keys.

Sublime offers many of the same shortcuts in its Vintage mode plugin. This plugin ships with Sublime, although it’s disabled by default.

Vintage mode isn’t a full-fledged emulation of Vim, but I find it provides many of the most useful Vim shortcuts for navigating and chopping up text. (I’m using it right now as I write this.)

For a more faithful Vim experience, you can also try out the Vintageous plugin (ST3 only).

If you sometimes feel like hacking your mouse to pieces, check out the Sublime Text Tips newsletter. You’ll get more free tips that’ll help you learn to work more efficiently while keeping your hands comfortably on the keyboard.

Get it here:

http://sublimetexttips.com/newsletter

About the author

josh

Click here to add a comment

Leave a comment: