Live data from Hacker News

Build muscle memory with your favorite editor

shortcutfoo.com

91–100 of 122 posts

Re: Build muscle memory with your favorite editor

#91
That's really fun. I love the site design, very slick.

Found a "bug". Some of the keyboard shortcuts conflict with my browser shortcuts.

For example, in one of the emacs drills, to move down a line (ctrl + n) it causes chrome to open a new window... so I could never complete the drill because of this.

Re: Build muscle memory with your favorite editor

#92

This really didn't work for me. I found needing to parse the command ("Move backward a word") broke the memory that I have built up over 15 years of using Emacs. Instead of naturally moving backwards with a flick of the fingers, I had to concentrate on where each finger was and on the key I was pressing. I think the goal of this is great, but as it stands, I'm not convinced it is going to help. Given it aborted my na…

Just to contrast, as somebody that's a novice-to-intermediate vim user, I really like this so far. The action verb model feels like it mirrors how I think when using vim, so at first blush, for me at least, it feels like a good fit.

I don't know enough about Emacs to compare there, though.

Re: Build muscle memory with your favorite editor

#93
post #39

If you want better shortcut muscle memory, just unplug your mouse for a couple days. Do this once a year or so. You can thank me later.

In OSX, are all dialogue boxes able to be accessed by the keyboard?

There's a direct way to do this:

Command + first letter button title

will activate that option, with a few caveats - Command-C won't work as Cancel, but Command-. will.

Re: Build muscle memory with your favorite editor

#94
post #39

If you want better shortcut muscle memory, just unplug your mouse for a couple days. Do this once a year or so. You can thank me later.

This is similar to how I learned the DVORAK layout actually. I switched to DVORAK, made sure that I had a couple of essays pushed off til the last minute, and bam! I knew it like the back of my hand by 3AM.

Dvorak was a long process for me. It took me about 3 months to get to 70 wpm (was 120 qwerty). Online gaming had a lot to do with the delay: switching keybindings for every game was annoying, and I needed to quickly communicate with teammates (or smacktalk opponents ;P)

Re: Build muscle memory with your favorite editor

#95
post #59

Earlier quoted context omitted.

In vim you can do that by putting these lines into ~/.vimrc: map map map map imap imap imap imap This will disable the arrow keys in normal and insert mode.

I'm not trying to be difficult here, just genuinely curious: why disable the arrow keys? Is it simply the speed boost you get from using hjkl on the home row vs moving your hand to the arrows? I use Colemak, so hjkl is very counter-intuitive for me, whereas the arrow keys make sense and aren't /that/ far away. EDIT: http://news.ycombinator.com/item?id=3684515 has some good explanations. So does anyone have suggestion…

Dvorak users can get away with using hjkl with the dvorak layout - it's not that counter-intuitive. Your Colemak layout, however, looks beyond salvageable in terms of using Colemak hjkl. I think a re-binding is in order there.

Re: Build muscle memory with your favorite editor

#96
post #89

This really didn't work for me. I found needing to parse the command ("Move backward a word") broke the memory that I have built up over 15 years of using Emacs. Instead of naturally moving backwards with a flick of the fingers, I had to concentrate on where each finger was and on the key I was pressing. I think the goal of this is great, but as it stands, I'm not convinced it is going to help. Given it aborted my na…

I agree. When I use vim, I just know the key to press to move around. I don't think "move to the next word -> w". I know I want to move the cursor and my fingers know where to be but not really what key I am pressing.

Sounds like you are already there then. This gets you back into the cognition of it all which you aren't used to because you don't have to think about it. Its probably more helpful for people with less experience. I too find myself getting confused when reading about VIM because I don't think about it that much.

Re: Build muscle memory with your favorite editor

#97
post #59

Earlier quoted context omitted.

In vim you can do that by putting these lines into ~/.vimrc: map map map map imap imap imap imap This will disable the arrow keys in normal and insert mode.

I'm not trying to be difficult here, just genuinely curious: why disable the arrow keys? Is it simply the speed boost you get from using hjkl on the home row vs moving your hand to the arrows? I use Colemak, so hjkl is very counter-intuitive for me, whereas the arrow keys make sense and aren't /that/ far away. EDIT: http://news.ycombinator.com/item?id=3684515 has some good explanations. So does anyone have suggestion…

When I use Vim I barely even use hkjl except to fine-tune larger movement commands. I'll search for a symbol, or move word-by-word, or use f/F/t/T to move to a different character on a line, which gets me in the ballpark.

Even if hjkl is faster, I would be optimising for a case that just doesn't show up that much.

Re: Build muscle memory with your favorite editor

#98

This really didn't work for me. I found needing to parse the command ("Move backward a word") broke the memory that I have built up over 15 years of using Emacs. Instead of naturally moving backwards with a flick of the fingers, I had to concentrate on where each finger was and on the key I was pressing. I think the goal of this is great, but as it stands, I'm not convinced it is going to help. Given it aborted my na…

Just to contrast, as somebody that's a novice-to-intermediate vim user, I really like this so far. The action verb model feels like it mirrors how I think when using vim, so at first blush, for me at least, it feels like a good fit. I don't know enough about Emacs to compare there, though.

It may be that muscle memory in editors is created like this:

  1. Identify a problem
  2. Think what I need to do to fix it
  3. Decide what keys I need to press
  4. Direct fingers to press keys
And that gets shortened eventually to:

  1. Identify a problem
  2. Direct fingers to press keys
If that is the case, then this might be a really good first step towards that process. I would certainly not look to me for that initial feedback.

Perhaps if I could try more complex things (that I don't have current muscle memory for), I would find it incredibly useful.

Either way, getting better at using your tools is always a good thing.

Re: Build muscle memory with your favorite editor

#99
post #48
post #39

If you want better shortcut muscle memory, just unplug your mouse for a couple days. Do this once a year or so. You can thank me later.

Step 2: undefine the arrow keys.

Or, remap the hjkl of vim, a ridiculous legacy of an obsolete keyboard Bill Joy just happened to be using at the time, to the normal inverted-T of cursor movement: ijkl. Then continue using the "arrowkeys" that are now under your right hand on the home row.

You'll then need to move the insert on left side of cursor, which was i, to h, the key on the left side of your index finger. Reach left to insert left. Easy for muscle memory. With that, both sets of arrowkeys on the keyboard work the same, and you won't need to disable one of them. Normal arrowkey muscle memory, and reach left to insert left. So easy.

Bill Joy was working in an era when keyboards didn't have separate arrowkeys and the ESC key was within easy reach. He wanted it to be as easy as possible to remember lots of different command keys. He used what was printed on his key caps, such as a straight line of arrows on hjkl and various English words such as "yank" in his design. It was a good idea at the time. He also realized that keyboards varied, so he made it all remappable to adapt to future keyboard designs--also a good idea.

But the programmers themselves couldn't adapt. The choices Joy made for that obsolete keyboard were frozen in amber by programmers whose habits were frozen in amber. These days, almost all keyboards have real arrowkeys, and people develop the muscle memory to use them long before they ever hear of vim. Also the ESC key, such a fundamental key, is off in Siberia.

For every vim user with vim habits based on an obsolete keyboard they don't use, there are 10,000 potential vim users with keyboarding habits based on the modern keyboards they DO use. Those 10,000 people use inverted-T arrowkeys, x/c/v as cut, copy, paste, they can't reach their ESC key, etc. Vim was designed to adapt, but old vimmers apparently weren't, so the design features that give vim its power are forever stuck behind arbitrary key layouts optimized for the wrong keyboard.

It makes more sense to remain consistent with existing muscle memory and keyboards, using the inverted-T arrangement ijkl, mapping your left-side insert to the left side key ('h'), and mapping ESC to something easy to reach, such as ';;'. Then, if you ever need to use a non-customized vim, just use the real arrowkeys, which will still feel natural. If you ever need to use another app with a serious vi mode, like zsh, it will be remappable to match your vi. (If it's not a serious vi mode but just a couple of vi-like keyboard shortcuts, either use the arrowkeys or do what we always do, given that every app has its own unique set of keyboard shortcuts: just learn a few new shortcuts for that app.)

Re: Build muscle memory with your favorite editor

#100
What I found missing in this is _why_ I would want to jump to a matching bracket, or insert a line before.

Perhaps the game should be to transform one block of code into something different in as few keystrokes as possible.

I would love to see videos of people using commands that are not a part of my current vocabulary.

Post reply on HN