9

I started getting RSI and I was browsing around for solutions when I read this:

What is the best way to avoid getting "Emacs Pinky"?

I love the solution of Mapping spacebar as both space and control but here's the problem:

I usually travel around a lot and don't have access to one computer. I make edits to my documents on several different computers where I don't have root access (heck, I don't even have normal access in some).

Is there a batteries included way of implementing the space bar solution? A small lisp code maybe?

Community
  • 1
  • 1

8 Answers8

6

(this is way too long for a comment but it may help you)

The space bar solution looks interesting although, at first sight, a bit too "hackish" for me but I may try it out...

Anyway I'd say the "Emacs pinky" problem is due to the default Emacs shortcuts, which have to be one of the most pain-inducing and RSI-provoking shortcuts ever conceived for a program (and this comes from a big Emacs fan so don't take that as Emacs criticism).

There are way too many defaults shortcuts that require using the pinky: CTRL-p (previous-line) comes to mind. That's two pinkies for you and it's supposed to be so smart because 'p' stands for 'previous'. All the C-x something and C-c something require way too much finger stretching too and I find M-x to be a terribly inneficient shortcut too...

I know this may comes as heresy, but quite some people are happy to use Emacs with vim-style navigation and, honestly, I can't blame them.

Personally I love the fact that under Emacs everything is configurable and so I came up with a personalized configuration that tries to:

  • minimize hand/fingers and pinky movements
  • maximize use of the "strong fingers"
  • maximize use of keys on which the fingers are already located ( (a)sdf and jkl(;) on a QWERTY keyboard, but 'a' and ';' means using the pinkies

I'm not against using the pinkies once in a while: but to me it's the repetition of way too many pinkies usage that may damage your hands.

So, as an example, instead of using CTRL-{p,n,f,b} to move around I use:

  • ALT-{i,j,k,l} (moving hands to the arrow keys is a big no-no).

  • ace-jump-mode

If you've never used ace-jump-mode you probably want to use it. It's one of the biggest time saver for Emacs. I've bound ace-jump-char-mode to M-e, which means I can get to any character I can see in a buffer in four or five keystrokes (including the two needed to hit M-e). This beats using CTRL-{p,n,f,b} any day and shall definitely help save your pinkies.

One may get fancy and modify ace-jump-mode so that the actual jump (the last keystroke) is performed without ever needing to hit a key requiring the pinky: looking at the source it looks quite easy (but then in some cases you'll need to use one additional keystroke: in any case this shall still be much faster than manually navigating around).

Here's a two minutes demonstration as to how to blazingly fastly jump around using ace-jump-mode (but even that great video doesn't do that mode justice: you really have to use it to realize how great it is):

"Emacs rocks! Episode 10: jumping around":

http://emacsrocks.com/e10.html

And then in addition to C-x and M-x, I've added C-, and M-, to act as C-x and M-x.

For example:

(define-key global-map [(control ,)] ctl-x-map)

I'd say that whether you find or not a portable way to use your SPC as a CTRL, you may also want to look in alternatives to C-{p,n,f,b} and C-x / M-x ('x', even if it's not requiring the pinky, is not very convenient IMHO).

tl;dr

To save your pinkies you can either:

  • turn on some ready-to-use vim-style mode

  • or spent the time needed to (re)configure entirely your Emacs to your liking and so that it stops destroying your pinkies (which may implies, but would not be limited to, using SPC as a CTRL if you find a portable way to do so)

In addition to that you may want to use emacs modes (like ace-jump-mode) allowing to save many keystrokes.

TacticalCoder
  • 6,275
  • 3
  • 31
  • 39
  • 1
    just to be clear about *ace-jump-mode*: when you're navigating on the line your cursor is already at, *iy-go-to-char* shall be faster (you should use both). With *ace-jump-mode* you need a tiny "pause" to read which key to hit to go where you want: but it still beats manual navigation in so many cases... – TacticalCoder Jul 09 '12 at 23:51
  • 3
    [jump-char](https://github.com/lewang/jump-char) is iy-go-to-char with on-the-fly highlighting and integration with ace-jump. – event_jr Jul 10 '12 at 00:42
2

I discovered key-chord mode recently : «Key-chord lets you bind commands to combination of key-strokes. Here a “key chord” means two keys pressed simultaneously, or a single key quickly pressed twice.»

The nice thing is, it is apparently possible to define a key-chord starting with the space bar. http://www.emacswiki.org/emacs-en/KeyChord (and see space-chord.el)

So that would solve your problem, right ?

Ehvince
  • 17,274
  • 7
  • 58
  • 79
  • I hesitated mentioning *key-chord* in my (very long) comment. It's nice but it's a bit tricky to get right: basically it's kinda hard to find enough key combination that are both easy to type and that aren't going to clash with things you may want to write. It's especially problematic when you're a fast typist because no matter how you lower the key-chord delay, you'll still be triggering it sometimes when you don't want to. But, yup, it's a cool piece of code and it can definitely help a lot. Btw any link/article to sane key-chord keys configuration would be welcome : ) – TacticalCoder Jul 10 '12 at 11:44
  • Yes, I think that's true now that I've been using it for a few days. However I found 3 good keys, which is just enough to bind to save-buffer and to switch buffer, and that's pinky saving ! (I use the keys ' followed by another ' and '« and '» , because I'm on a french version of dvorak called bépo.) – Ehvince Jul 12 '12 at 08:06
  • There are many rare 2 character combinations based on strong fingers (middle, pointing, thumb). I use **9X** and **3X** combinations where the '9' and '3' are just because they cause the combination to be extremely rare and the second character for mnemonic reasons like "9f" = find file, "3j" = ace-jump, etc. it turns to be very efficient and I've never triggered it by accident. – szymzet Sep 26 '15 at 13:13
1

You might consider ErgoMacs which is supposed to solve just this problem. I haven't tried it since I had been using Emacs for half a decade before I found it. I do have a huge number of keyboard customizations though, including C,M-i,j,k,l movement (not exactly vi-style).

Ivan Andrus
  • 5,221
  • 24
  • 31
1

Even with a Kinesis Advantage keyboard, which helps tons, I was still suffering from wrist and thumb issues after too many years of ctrl-n, ctrl-p, etc. So I was exploring vim, and came across the evil package for emacs. It's awesome. Once you learn the vim bindings and get used to hitting escape, non-modal editing (using crazy combinations of ctrl-meta bindings), seems absolutely nuts from an ergonomic perspective.

So I definitely recommend any emacs pinky or thumb sufferers to try evil-mode and learn the vim bindings.

justingordon
  • 12,553
  • 12
  • 72
  • 116
0

This may sound like a hack, but my suggestion is to switch from the default Emacs keyboard mapping to one of the vi emulators. I use Viper, which I believe is a standard package. I think you can enable it on demand with:

(require 'viper) M-x viper-mode

This is the only way I've ever been able to work with emacs, since I've always found its basic keyboard mapping pretty much incomprehensible.

The only downside, besides the learning curve it may require if you are not already conversant with vi, is that you may replace 'emacs pinky' with 'escape-key-finger'

Howard West
  • 381
  • 3
  • 6
0

Partially, yes.

There's similar utilities that run totally in the user space, namely Space2Ctrl and Keydouble. Both need X.

I'm the author of at-home-modifier, "use space both as ctrl" software. As I compare these three here, Space2Ctrl and Keydouble have less options than at-home-modifier, so may not be "batteries included", but codes (C++ / C) are simple, and it's probably easy to hack.

Take good care. (I wrote mine because my pinky started to pain, but it's good now. But don't overuse thumbs.) The README of at-home-modifier also gives some more advice on health and keyboards.

teika kazura
  • 1,348
  • 1
  • 16
  • 21
0

rempap your numpad.AHK Script,

NumpadIns::^s
NumpadEnd::^c
NumpadDown::^v
NumpadPgDn::^x
NumpadLeft::^+v
NumpadClear::Control
NumpadRight::^a
NumpadHome::q
NumpadUp::Tab
NumpadDel::^f
NumpadEnter::Space


1 : copy
2 : paste
0 : save



Buy a new numpad for ease of use.

0

After using emacs for almost 10 years, I think the best way to avoid emacs pinky is to remember:

Bind the keys such that you never press two or more keys at the same time with one hand!

This completely eliminates any hand problems I used to have.

For example, C-x should always be pressed like this: C (right hand) - x(left hand)

Using space or caplock to replace control will delay but not completely prevent your hand problems. The only way to prevent them is to never press two keys at the same time with one hand.

DataHungry
  • 351
  • 2
  • 9