views:

302

answers:

12

What specific techniques have you found to learn keyboard shortcuts while programming?

I don't mean "look them up in the list" learn. Rather, what techniques do you use to build the automatic muscle memory that so many of us have after a while?

Do you pick one keyboard shortcut per day and practice it throughout the day? Do you focus on learning them all at the same time? Do you learn one application's shortcuts, then move to another? Do you have strange "games" you play to remind you? Nothing? Something radical?

It's an interesting question to me because my new (first) Mac is arriving soon and I'm interested what methods I'm going to use to most quickly learn to avoid the mouse as much as possible in an environment that I am completely foreign to.

+7  A: 

One key feature at a time (no pun intended).

I use boredom-driven learning. When I get bored of calling one common feature with the mouse, I get the keyboard shortcut quickly. One at a time, without planning. Get the things done, don't let the shortcuts take focus on your task. They'll come fast enough if you don't care too much about them.

subtenante
This is a very wise assessment. My problem is that I tend to "forget" to learn and just keep working inefficiently while I live with a developing underlying frustration with the system (as I've done with Windows these past couple years while I can't run Linux at work). I understand that's a personal issue. I guess I was looking for something in between-- more something to keep me mindful of that goal to learn.
JohnMetta
Then I guess Lars's answer has rightfully been chosen as accepted. A compromise would be not to take a cheat sheet but make your own a little at a time.
subtenante
+1  A: 

I've used the "cold turkey"-method with some success: simply remove the mouse. Put it where you can't reach it, and try to get along.

JesperE
Wow, impressive. But... why ?
subtenante
This was my original method a long time ago, but it was mindnumbingly painful because my productivity was basically NIL for a period. I can't do that again.
JohnMetta
In an attempt to become more productive. Unfortunately it failed, but mostly because there were too many things which I couldn't figure out how to perform without a mouse. And navigating webpages was just to painful.
JesperE
While your there, change to dvorak, colemak, enti-key++ or any other keyboard, now go on and try to be productive, I'm watching! ;)
Trillian
@Trillian: no thanks ;-)
JesperE
+2  A: 

Find a reference card/cheat sheet listing the most useful shortcuts, then print out a copy and tape it onto the side of your monitor.

After you've used the application for a good while, getting used to most shortcuts, reread the full documentation and discover new stuff that didn't strike you as very useful the first time around.

Lars Haugseth
I got yellow stickers on my monitor with recently found useful shortcuts. Changing them time by time. :)
Arnis L.
+1  A: 

Shortcuts are a matter of convenience and I end up becoming comfortable with them when I use them a lot.

In other words, I don't practice shortcuts I'll use once in awhile, and shortcuts I use all of the time (Copy, Paste, comment code block, etc.) eventually make it into the "I can do this with my eyes closed" repertoire.

Nothing radical, no games, no practice -- just usage.

micahtan
A: 

I print out a comprehensive cheat-sheet of shortcuts, and keep it on my desk. I pick one or two important ones from that list, write them on a post-it note, and stick it to my monitor.

Once I've got those down, I pick a couple more and repeat.

Gabe Moothart
A: 

Personally I don't really like keyboard shortcuts, they hinder me moving between GUIs and I don't really find they speed me up that much--but I think that's just because I think slower than I type, your mileage may vary.

Most of my "Coding" time is spent trying to figure out how to remove redundancies and simplify my design--I never just type a method and leave it, most I re-write a few times until they are readable and fairly debugged; so typing speed isn't all that relevant. When I don't pay the time before I code, I pay it in refactors and bugs later.

Anyway, I figure out a keystroke when I do something enough that I think I just have to figure out what it is. After years of using Eclipse, I know maybe 5 accelerators.

ctrl-shift-t (goto type) is probably the most usable of them all (well, after ctrl-space which I don't even consider an accelerator, just part of typing).

optimize imports comes in handy (I think it's shift-alt-o)--but 9 times out of 10 ctrl-space does this for you. It's good when you are pasting in a lot of code.

Every so often I hit ctrl-1 to open up a "common fix". I do this when I'm "Fixing" a lot of things at once.

ctrl-shift-L gives me a list of all shortcuts if a new one comes up.

That's pretty close to "it".

Bill K
Ctrl-C, Ctrl-X, Ctrl-V. Surely you're not using the edit-menu to copy/paste text?
JesperE
Yeah, but I don't consider that part of coding any more, like ctrl-space it's more a part of typing. (I find myself trying to hit ctrl-space in chats and stuff all the time now when I don't feel like typing the rest of a word or I want it to fix my spelling for me! WHY can't that work everywhere???)
Bill K
A: 

Pair programming. Ideally, promiscuous pair programming.

Your IDE has thousands of commands, and if you set out to learn all of them, it will take a long time and ultimately not be worth the trouble. The important commands are the ones you use (or ought to use) all the time, the ones that save you a lot of time. If you pair with other programmers, every they do something amazing - every time you're expecting to see a lot of steps, and the change "just happens" - you yell out, "Hey! How did you do that?" and your partner tells you. The shock and delight of that experience will keep that trick in your head. It's the best way to learn.

The reason to pair promiscuously is that each of us has learned different shortcuts, different techniques; the more people you pair with, the more opportunities you have for exposure to great tricks.

This kind of learning isn't deliberate; it's natural and takes place in parallel with actually getting your work done.

Carl Manaster
+2  A: 

I tend to learn shortcuts by noticing which functions I need most and making a note of the shortcut as I'm selecting a function with the mouse. Of course, this only works in applications that show the keyboard shortcut along with the main menu item or in a toolbar button tooltip. (Fortunately, Eclipse does do this.)

Mike Daniels
A: 

I spend a lot of time editing people's crappy code: Ctrl-K + Ctrl-C = <3

Spencer Ruport
A: 

to add to subtenante response (since i don't have enough mojo to actually comment there), if i find myself using the mouse do something repetitively (my threshold is 3 times, ie: the third time i notice myself mousing the same task) i look up to the keyboard shortcut and do that a couple times as practice immediately. the next time it comes up, i try to do it from memory, and if i fail then i look it up again, but i don't mouse it. the latter scenario hardly ever happens anymore unless i am switching between mac, windoze or linux.

Peter Cowan
+1  A: 

Do it like how speed cubers memorize cube algorithms

  1. Read a shortcut
  2. Practice it 20-30 times (initially with referring to the list of shortcuts)
  3. Try to understand the reason behind keeping the shortcut as what it is (e.g. ctrl+C for Copy and so on. This step will take mental CPU time but will settle the shortcut in your near term memory
  4. Revise the same Shortcut at these intervals -> 6 Hr, 24 Hr, 3 d, 1 w, and by then you would have got it!

Some software like Photoshop have way to many shortcut keys to actually assimilate all of them but practice is the best option.

OrangeRind
+2  A: 

When I was starting on the Mac, I used keycue to help out. It presents a quick summary of all of the shortcuts for the current app.

For intellij, there's a plugin called "keypromoter" that will flash the shortcut on the screen for an action you did on the mouse. If you use a mouse action too many times, it asks you if you'd like to assign a new shortcut to it.

Ted Naleid
This, my friend, is brilliant! Thank you. (I love that it actually prompts you to assign a key to it!). Thanks for Keycue too, I'll look into it when my Macbook Pro arrives.
JohnMetta