40

I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "Emacs Pinky" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid potentially getting this type of repetitive strain injury?

ofthelit
  • 1,341
  • 14
  • 33
Ray
  • 187,153
  • 97
  • 222
  • 204
  • 5
    The answer is in the paragraph you reference. – kjfletch Sep 01 '09 at 12:54
  • 2
    See also the [RSI page](http://www.emacswiki.org/emacs/RepeatedStrainInjury), which is concise, but virtually exhaustive, in the Emacs Wiki, rather than browsing this scattered page. – teika kazura Mar 31 '12 at 08:00

33 Answers33

53

Making caps lock another control key is a good place to start. Invest in an ergonomic keyboard. Some emacs users even go as far as to get foot pedal things for control and meta...

chicks
  • 2,393
  • 3
  • 24
  • 40
Alasdair
  • 778
  • 7
  • 10
  • 1
    Autohotkey is probably the best tool for keyboard remapping. You could map CapsLock to Control really easily and make it like that just for Emacs if you so chose. You can also make Shift+CapsLock work as CapsLock. http://www.autohotkey.com/ – David Webb Sep 12 '08 at 13:16
  • 7
    That's so excessive. – Joe Phillips Jan 25 '09 at 00:16
  • 12
    I thought the foot pedals were so they could add more modifier keys. – intuited Apr 20 '10 at 13:10
  • 6
    Haha! Foot pedal? Got to get one of those :) – armandino Jun 04 '10 at 20:23
  • 2
    Plus 1 to this. I have caps lock mapped as another control key on all my personal machines. – Tim Bielawa Nov 03 '10 at 19:35
  • 8
    Binding Control to Caps Lock is a poor solution; you're still using your pinky, and now you're only using one of them. Try using a layout like the one found on Lisp machines. – Joe Snikeris Sep 14 '12 at 12:42
  • 1
    I've had bad RSI for the last year, even though I had capslock remapped to control. Foot pedals are NOT excessive. Key chords make my hands feel much worse, so I use pedals for Ctrl/Shift/Alt so I never have to hold down keys with my hands. If you're not taking ergonomics seriously you will regret it. – Joseph Garvin Oct 03 '14 at 22:12
  • I strongly suspect having caps lock remapped to control, coupled with the habit of using it to hit C-x, C-c, C-f, C-s, C-e, C-t (really any letter on the left side of the keyboard) with two fingers of the same hand, is what caused the tennis elbow with torn tendon that I am now recovering from surgery to fix. Find a better solution. – hoff2 Feb 09 '15 at 20:54
  • @hoff2 What about Right control + x/c/any left key ? Would that be the best approach in your opinion (instead of all these complex key mappings and pedals) ? – Zombies Jun 01 '15 at 13:07
  • @Zombies I think the biggest issue for me was the bad habit of hitting the modifier and the letter with different fingers of the same hand. This cause me to twist my forearm in some funky ways that while not immediately uncomfortable, ended up being a problem for my tendons. – hoff2 Jun 02 '15 at 14:48
  • 2
    @Zombies Right now I am trying to break that habit and use both hands properly with Caps Lock remapped to Control but also using Karabiner to make the Enter key be a Control key similarly placed on the right (when used as a modifier key -- when pressed by itself it still acts as Enter). At first it was problematic when I was typing fast, but I seem to have gotten the hang of the timing now. I think the placement of the normal Control keys on most keyboards is part of the larger problem. – hoff2 Jun 02 '15 at 14:54
  • Everyone's gotta experiment and figure out what will work best for them, though, even to the point of using foot pedals, ErgoEmacs, etc – hoff2 Jun 02 '15 at 14:55
  • I find Emacs really interesting because of my interest in Lisp. I'm a Vim user though and I find Emacs rather painful to use. I'm sure there must be shortcuts that I haven't learned to speed things up, but it'll never complete with being able to type single letters for commands. My concern other than just being painful to use is that it'll do damage. I feel like we need to figure out how to merge Emacs and Vim (I'm aware of Evil, but apparently that has issues). That'll probably present a new learning curve for existing users, but I wonder if it would be worth it... – bambams Feb 16 '16 at 03:40
  • @bambams You might want to look into spacemacs. – balu Apr 09 '16 at 02:28
30

Configure so that the space bar works both as space and control; when the space is pressed alone, as a space, and pressed with others, as ctrl. So Space + x is treated as Ctrl + x.

You can do it with AutoHotKey in Windows, and with "at-home-modifier" in Xorg in Linux. (X, but Linux only.) You can use Karabiner (formaly known as keyremap4macbook) in Mac. (In fact, I am the author of at-home-modifier. =)

You can do more, if you have a keyboard with many keys around the space, like Japanese keyboards:Japanese keyboard http://www.owltech.co.jp/products/keyboard/KB86STD/KB86STD_B-320.jpg

My bottom row is basically EscBSSpaceEnterTab, but when used as modifiers, it's AltShiftCtrlShiftAlt. (For example, if you hold down Esc first and then Space, it's Alt+Space, but Space followed by Esc, it's Ctrl+Esc. If you press Space, Esc, and x, then it's ctrl + alt + x.) All can be pressed with the thumbs. You can order a Japanese keyboard from say amazon.com. You don't have to speak Japanese.

This is extremely handy. For firefox (sorry, not emacs) for example, focus a link, and press Ctrl + Enter; then it'll be opened in a new tab. (By also pressing Shift, it'll switch to the new tab, rather than staying on the current.)

(The above picture is the one the author of at-home-modifier uses. The maker doesn't sell this model any more, though.)

Community
  • 1
  • 1
teika kazura
  • 1,348
  • 1
  • 16
  • 21
  • 3
    How do you get Ctrl-space? – mark999 Dec 14 '12 at 01:54
  • 1
    1. If it's limited to Emacs, just rebind set-mark-command to some other key. 2. In general, make one more space, ctrl, or space/ctrl. (There's nothing extra. Having two space/ctrl is far better than plain ctrl and space.) – teika kazura Jan 02 '13 at 11:51
  • Great great great! Keyremap4macbook is awesome – juliomalegria Mar 02 '13 at 23:41
  • 1
    Thanks a lot! Spacebar as control is a great idea! – Chandresh Pant Nov 27 '13 at 15:43
  • With at-home-modifier ctrl+space works fine even after setting space as space/ctrl. If you do not wish to use the regular ctrl anymore, the set-mark-command is also bound to ctrl+@ or you can rebind to something else. – fgui Aug 19 '15 at 06:19
  • I want to know whether Karabiner is safe. It asks for some permission. So can anyone tell me it's not logging my password? – Ansuman Bebarta Dec 04 '15 at 16:53
20

alt text http://www.userfriendly.org/cartoons/archives/07sep/uf010710.gif

@ Xiong Chiamiov

DenverCoder9
  • 3,635
  • 3
  • 31
  • 57
15

Get a foot pedal! (I have a kinesis.) After you do, unmap control and capslock so you force yourself to use your feet.

(FYI, remapping capslock will help, but after enough emacsing in one day, will not be a total solution.)

  • 2
    If you have a [Kinesis Advantage](http://www.kinesis-ergo.com/advantage.htm) you don't even need the foot pedal since control is easy to reach with either thumb. :) – Gordon Gustafson May 28 '13 at 02:15
14

For the love of God - use another text editor! If it's something that requires a foot pedal to work with it normally, then... well... frankly, I'm speechless. There is a multitude of powerful contemporary text editors out there that don't require you to memorize volumes of arcane keystrokes or buy fancy hardware.

You know, I can understand and accept a lot of things, but a foot pedal for a simple text editor is really where I draw the line.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Vilx-
  • 104,512
  • 87
  • 279
  • 422
  • 5
    That's hilarious! I used emacs years ago and I understand what people like about it, but your answer does make it look pretty silly. – John D. Cook Jan 10 '09 at 16:04
  • 29
    the memorizing 'volumes' of 'arcane' keystrokes, though, is really subjective. To become equally proficient in any other editor you'd have to memorize scores of commands anyway. – Adriano Varoli Piazza Jul 21 '09 at 13:31
  • 1
    Might be. I have honestly no experience with Emacs at all, so I can't say how it compares to other editors. I know that it is scriptable to the extreme, so it is one of the most powerful editors by definition, however, if we compare just the out-of-the box features, the story might be different. Also - Emacs is way older than Windows, and uses many idioms that Windows users are unfamiliar with. Therefore I speculate that for Windows users Emacs might actually NOT be the most productive environment without a steep learning curve. – Vilx- Jul 21 '09 at 18:13
  • 4
    +1, redundant answer - use vi – elcuco Dec 03 '09 at 21:18
  • 17
    Actually I find emacs to be much faster than so-called "more modern" tools, specifically because everything is accessible from the control and alt keys. There's no requirement to move one's hands from the keyboard to the mouse to click here and there. And another thing - Why is a foot pedal any more ridiculous than a hand pedal? The first cars used only hand controls, for steering, accelerating, slowing, and shifting. Designers moved to foot pedals because it worked better - one didn't need to move one's hands from the wheel to do some operations. – Cheeso Dec 08 '09 at 19:28
  • 1
    Don't take it so personally! The answer was only half-serious! :) Yes, I completely understand that Emacs can be far more powerful than other editors, and a foot pedal can even more add to productivity. No doubt about it. But the point is - this day and age there are already some standard ways how things are done, and most people are used to them. Cars have standard controls too. I've no doubt that they could be more efficient, but the car would then be unusable for most population and considered a "freak". Like Emacs. – Vilx- Dec 09 '09 at 00:10
  • On the subject of learning curves: http://blogs.msdn.com/b/steverowe/archive/2004/11/17/code-editor-learning-curves.aspx – Xiong Chiamiov Jun 03 '10 at 21:31
  • @Xiong - yes, it's a classic. :) – Vilx- Jun 04 '10 at 00:22
  • Just try ergo emacs, when you want standard shortcuts. – Arne Babenhauserheide Sep 09 '12 at 21:07
  • 3
    On the other hand, I love working in emacs, and feel obstructed whenever I use something else. And you really don’t need foot pedals. They are the equivalent of jet-like controls in a car. Or specialized gaming joysticks. Most people don’t understand them, but there are power-users who do - and they are the ones who use their systems to the extreme. – Arne Babenhauserheide Sep 09 '12 at 21:15
  • Blasphemy, I know, but this reminds me of [Zimbu from Dilbert](http://dilbert.com/strips/comic/1994-03-28/) – BryanH Feb 05 '13 at 19:35
  • 11
    This answer might be funny, but otherwise it's worthless. Emacs is literally a virtual Lisp machine: it has built-in and third-party news/e-mail readers, IRC clients, a file-manager, version-control interfaces, a native shell, a terminal emulator in which you can run another shell or other terminal-based programs, an interface to the text-based WWW browser W3M, and also LOTS of text-editing related functionality you won't see in any other text-editor, except of course Vim. "Emacs is an OS" is not a joke, except the part about it not having a good editor. ;) Also see its Vim-emulator "Evil". – TaylanKammer May 24 '13 at 07:57
  • I was a happy vim user between versions 5 and 7 and then switched to emacs. It's dynamism at your (pinky) fingertips. Switching caps and ctrl does the job for me. Also, no need to memorise the "arcane" command sequences. If you get stuck, plenty of great interactive documentation for each function that can be called interactively (a keystroke in emacs maps to a function). Not to mention that many important commands can be called via the menu bar which has a key combo next to the label: good for learning/remembering – Mali Remorker Jul 17 '16 at 13:59
  • @MaliRemorker - By the way, out of curiosity, what are some good things that you use in emacs **commonly**, but which are normally unavailable in "typical" text editors (Notepad2/Notepad++/Sublime/Visual Studio/etc)? – Vilx- Jul 17 '16 at 16:35
  • @Vilx Hah! The obvious answer would be the [org mode](http://orgmode.org/) . Joking aside, what attracted me to Emacs: it's an extensible virtual machine with it's own REPL and just feels natural when used with dynamic languages; i never felt that level of immersion in coding with any other editor [true, Vim came close, but only for compiled languages]; – Mali Remorker Jul 18 '16 at 06:32
  • Hmm, that's interesting. I've never felt the need for that. In fact, I find it difficult to imagine it being useful at all, except under some rare circumstances. Most systems that I've worked with normally function as a whole, and evaluating a few isolated expressions here and there... just doesn't add much value, as far as I can see. Are you working on different sort of projects, or am I missing something? – Vilx- Jul 18 '16 at 06:50
11

I have always been curious about why such a large community of programmers, writers, geeks, etc. haven't yet found super simple and effective solution to this problem. Simply: 1) take a small piece of paper, make paper ball of it; 2) use scotch to stick it on to your left ctrl key (temporarily removing it from the place); 3) when writing, use side of your left palm to press that key - now this key is higher than others and you can do it easily. That way you don't need to buy uber ergo-keyboards, or remap ctrl key to capslock (which you eventually will push with your pinky anyway)...

So much discussions about such a small problem.

pauls
  • 109
  • 1
  • 2
  • 2
    See [my answer](http://stackoverflow.com/a/8935973/780703). It's far better to hack the keyboard and press the Ctrl with your thumb than using a palm; you don't have to move away from the home row at all. – teika kazura Mar 31 '12 at 08:32
10

Remap Left-Ctrl and Caps-Lock so they are where they should be:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,1d,00,1d,00,3a,00,00,00,00,00

 

chicks
  • 2,393
  • 3
  • 24
  • 40
Eric Z Beard
  • 37,669
  • 27
  • 100
  • 145
  • 1
    Also, the Ctrl2Cap utility from Microsoft works well. (http://technet.microsoft.com/en-us/sysinternals/bb897578.aspx) – James Sulak Sep 10 '08 at 13:11
  • 1
    If you're on a unix system, xmodmap can be used to swap keys. The latest version of Mac OSX gives you a dialog to make this swap. – Bryan Oakley Sep 18 '08 at 14:41
  • KDE has an option in Personal Settings > Input Devices > Advanced > Ctrl Key Position for making caps lock an additional control. – Tikhon Jelvis Jul 28 '11 at 22:05
7

I use the excellent key-chord mode for common actions. You can give it functions or key sequences to call.

To make sure I do not obstruct normal typing too much, I generated letter statistics to find good key chords. I recorded them along with my default chords.

Additionally to more convenient command-calling, I have chords for inserting stuff like

Best wishes,
Arne

I hate writing emails without that ☺

Also I use control lock mode for things like flyspell, where I need control all the time. That’s modal editing with real emacs shortcuts.

The chords I use the most are

; buffer actions
(key-chord-define-global "vg"     'eval-region)
(key-chord-define-global "vb"     'eval-buffer)
(key-chord-define-global "cy"     'yank-pop)
(key-chord-define-global "cg"     "\C-c\C-c")
(key-chord-define-global "äü"     'control-lock-toggle)

; frame actions
(key-chord-define-global "xo"     'other-window);
(key-chord-define-global "x1"     'delete-other-windows)
(key-chord-define-global "x0"     'delete-window)
(defun kill-this-buffer-if-not-modified ()
  (interactive)
  ; taken from menu-bar.el
  (if (menu-bar-non-minibuffer-window-p)
      (kill-buffer-if-not-modified (current-buffer))
    (abort-recursive-edit)))
(key-chord-define-global "xk"     'kill-this-buffer-if-not-modified)

; file actions
(key-chord-define-global "bf"     'ido-switch-buffer)
(key-chord-define-global "cf"     'ido-find-file)
(key-chord-define-global "zs"     "\C-x\C-s")
(key-chord-define-global "vc"     'vc-next-action)
Arne Babenhauserheide
  • 2,423
  • 29
  • 23
7

I totally agree with the remap caps-lock solution, that helps quite a bit. To go even further, I tried and liked the Ergoemacs keybindings. The project is being actively developed, and supported quite well. I personally don't use it because it's not integrated with Mac OS X (some EMACS Keys are integrated in Cocoa), though it seems someone has posted an inputrc file with Ergoemacs keybindings. Another trick I've been playing with is enabling StickyKeys. It's supported on many platforms and alleviates some of the problems specific to chording (as opposed to just overuse): it is apparently recommended on the emacswiki: http://www.emacswiki.org/emacs/StickyModifiers

Chow
  • 465
  • 1
  • 5
  • 6
6

First I'd like to point out that suggesting not to use Emacs because the default keybindings may not be for everyone doesn't make any sense. Emacs is the most configurable "text editor" ever made and so, of course, trivial things like keymappings are fully configurable.

Regarding the "Emacs pinky" issue, I noticed that several people have "anti-Emacs-pinky" keybindings in their .emacs, like user "Paul Nathan" (17.5k rep as I type this) here:

What are good custom keybindings in emacs?

Then it is known for a fact that many people prefer the vi way and user Emacs' viper-mode.

I think that the major issue in Emacs is, by default, over-reliance on CTRL and more specifically C-x and C-f / C-b. These three are really terrible because it means, IMHO, painful fingers distortion.

So to me first the problem has to be defined: what is the issue? The issue is an over-reliance by default on CTRL, the fact that CTRL is typically badly located on most keyboards and the fact that most keyboard out there (I'd guesstimate more than 99.9% of all keyboards ever produced) are total pieces of junk.

So what is my solution to this?

  • I use a good mechanical keyboard and I do touch-type. People really serious about this will probably shell out $$$ for a very good split & matrix keyboard (like the Kinesis Advantage)... Because split and matrix are the only kind of keyboards that makes sense from an ergonomic point of view (this is not even open for debate). I, sadly, have been typing for three decades and cannot adapt to matrix layout, so I'm using an old (flawed) staggered keyboard. If you're going to use a staggered keyboard, at least take one that has a good switch (for example buckling springs like in the IBM Model M or Cherry MX switches or Topres like in the Happy Hacking Keyboard Pro). Be ready to shell out $500 and more if you hope to find a split + "mechanical" staggered, like the Cherry MX-5000 (*) or the IBM M15.

So: in short, if you're really serious about this, go for a Kinesis Advantage (they're using Cherry MX switches and you can even choose your specific switch if I'm not mistaken).

If, like me, you sadly cannot adapt to these wonderful keyboards because they're "too different", then go for a good "mechanical" keyboard. Any keyboard allowing not to "bottom out" while typing will save your fingers' joints. Helps after decades of programming.

If you don't want to go the "mechanical" route and think rubber domes are fine keyboards (I consider them junk but each it's preference), then at least choose a good rubber dome. MS' Ergo 4K would be a good choice (once again: it's rubber dome so to me it's a finger-destroying junk, but it's a matter of taste).

  • once you're using a good keyboard, remap CAPS-LOCK to CTRL. Can be done on any OS. It's trivial and there are plenty of links on the subject.

  • Remap Emacs' keys to stop over-relying on CTRL. First CTRL-x is terrible. It really has to be the worst shortcut ever. But you can remap ctl-x-map to what you want. I do this in my remapping minor mode:

    (define-key my-keys-minor-mode-map (kbd "C-,") ctl-x-map)

C-, might not suit you: pick something else...

Then there's the issue of cursor movement. I think it's a big one for "text editor". Even if tend to use all the fine Emacs functions to quickly move around the text buffers instead of "moving the cursor", I still do need to move the cursor "manually" quite often.

C-f / C-b have to be the two most stupid shortcuts to move the cursor ever.

I use M-{i,j,k,l}. So people prefer {hjkl} instead of {ijkl} but I like {ijkl} because it reproduce the inverted T-arrow. I also like the fact that when, as a touch-typist, you're in your home row, you already have three fingers on {jkl}. No crazy finger motion to reach 'f' or 'b': makes no sense.

Last but not least: when you're not typing, do rest your fingers on your keyboard. For this of course you need a keyboard with a good switch which has enough resistance not to activate when you're simply resting your keys on your keyboard.

Community
  • 1
  • 1
TacticalCoder
  • 6,275
  • 3
  • 31
  • 39
  • (*) I do own several good keyboards: I have several IBM Model M, one Cherry MX-5000 (some have sold on eBay for more than $1000) and one split+matrix keyboard using white ALPS keyswitches. I do type since nearly thirty years and do touch-type since 15 years or so. If only I could adapt to real split+ergo keyboard, I wouldn't think twice before shelling out big bucks for a Kinesis... – TacticalCoder Mar 30 '12 at 13:38
4

One solution not yet mentioned here is to use both hands for key combinations.

For example, suppose you want to press <CTRL-K>. On QWERTY-keyboards, <K> is on the right, so press <CTRL> with your left hand and <K> with your right hand. Once you get used to the system, it works fine.

mzuther
  • 1,158
  • 1
  • 13
  • 24
  • You're still pressing ctrl with your pinky, neh? – Xiong Chiamiov Jun 03 '10 at 21:34
  • 1
    You're right. But by using both hands, you're avoiding repetitive strain injury, and that's what the question is about. At least, that's what I THINK the question is about. :) – mzuther Jul 12 '10 at 18:58
4

My advice would be to try using your thumbs to press modifier keys (control, alt) when they are within a reach. On keyboards which have shorter space-bar it is possible to press Alt (Meta) even without bending your thumb inwards. You can remap e.g. right Alt to Control and this way be able to conveniently access both Control and Alt. This is also possible on MS Natural Keyboards.

boskom
  • 840
  • 1
  • 7
  • 12
4

Consider a Kinesis Contoured keyboard. It took me about a month to get up to speed with mine and I now consider it to be the ideal Emacs keyboard, even without the foot-pedal.

No joke. I ordered my first one with a food-pedal, but found I wasn't actually capable of coordinating the timing of my feet and my hands sufficiently to make much use of it for modifier keys. For a while I used it to toggle the integrated number pad, but I gave that up when I realized I wasn't using it because the number row on the Kinesis is so easy to reach.

Community
  • 1
  • 1
bendin
  • 9,424
  • 1
  • 39
  • 37
  • +1 I find Ctrl is even easier to reach on a [Kinesis Adantage](http://www.kinesis-ergo.com/advantage.htm) than 'e' is on a regular keyboard, so a foot-pedal is unnecessary IMHO. Just one of the many things that made it worth the money. :) – Gordon Gustafson May 28 '13 at 02:23
4

The Microsoft Natural Keyboard has been very, very good for me. I use emacs for everything 10+ hrs a day with no problems.

Ben Collins
  • 20,538
  • 18
  • 127
  • 187
  • For most common keystrokes, I swapped M and C. E.g., M-n is now 'down-line'. My thumb lies right over M on the MSNK and it works wonderfully. – Paul Nathan Jun 04 '10 at 21:00
  • MSNK is a fake ergo. Keys like Esc and "y" lie very far from the home position. And key touches are bad. (Cf Realforce or HHKB.) But its shape seems good for your wrists. – teika kazura Mar 31 '12 at 08:09
  • @teikakazura: fake or not, wrist comfort is everything. I'm on my third MSNK, and the key touches are quite nice, if not ergo. – Ben Collins Mar 31 '12 at 23:41
  • @Ben Ok. But it's not for pinkies. OTOH, Realforce is incredible, despite of its mediocre look; the keys to press with the ring fingers have lighter touch, i.e. require less force to press, and pinky keys are even softer! – teika kazura Oct 17 '12 at 05:55
3

Try viper-mode, which is a vi emulator in emacs. As someone who has switched back and forth between vi/emacs/vim several times in the last 25 years, I'm now finally trying viper-mode in emacs, and I like it. I find the vi commands to be more comfortable, but I can still keep the advanced features of emacs that I like.

Greg Graham
  • 484
  • 4
  • 11
  • 2
    [Evil is the best VIM emulator for Emacs](http://www.emacswiki.org/emacs/Evil). I personally have never used anything else, but it's worked flawlessly over 99% of the time and I've heard quite the opposite about others like viper. – Gordon Gustafson May 28 '13 at 02:07
3

I use emacs and bash all day every day, and I have capslock as an extra left-control key, like VT100 intended. Nobody's mentioned the best way to do that on X11, yet. (actually, this is specific to the X.org/xfree86 X server, which everything uses these days):

setxkbmap -option ctrl:nocaps

 Or edit your xorg.conf to have
Section "InputDevice"
        Identifier  "Generic Keyboard"
        Driver      "kbd"
        Option      "XkbRules" "xorg"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
        Option      "XkbOptions" "ctrl:nocaps"
        Option      "Autorepeat" "200 40"
EndSection

(The XkbOptions and Autorepeat are what I added to the pre-generated one. Then X will start with the right key mapping every time, and you don't have to find where to put setxkbmap to have it executed every time you log in and start your window manager.)

Although gnome does have a keyboard manager thing, as boskom mentioned.

FYI, emacs was originally written for MIT lisp machines with "space cadet" keyboards. X11 has super, hyper, alt and meta modifier keys. Sometimes the "windows keys" on PC keyboards are mapped to Super. They're handy to bind to window-manager stuff (e.g. switch virtual desktops) because almost no apps normally use them.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
3

to Chow,

yesterday i found a solution that we can have system wide ErgoEmacs keybinding on the mac.

The trick is to use mac os x's keybinding system so that you have system wide ErgoEmacs keybinding with the Control key. Then, in OS preference, swap the Control and Cmd key.

So that, you get ErgoEmacs keybinding system wide with the modifier beside the space bar. The draw back is of course that normal mac Cmd+key is now at the corner of keyboard. So, it's a trade off, about whether you use most apps for text editing, or the app's shortcuts.

might give it a shot here: http://code.google.com/p/ergoemacs/wiki/ErgoEmacs_keys_system_wide

also, few years back i tried the mac's os wide custome keybinding, some cocoa apps still doesn't support it. See bottom here

How To Create Keybinding In Mac OS X

but perhaps things are better now.

glenn jackman
  • 238,783
  • 38
  • 220
  • 352
Xah Lee
  • 16,755
  • 9
  • 37
  • 43
3

One more approach: if you want to avoid getting "emacs pinky" simply do not use pinky to press control key.

If it is necessary remap keys on your keyboard to go in the following order:

[Ctrl][Alt][ Space ][Alt][Ctrl]

On any standard keyboard (which symmetrically positions modifier keys, e.g. any MS keyboard) now you can press Ctrl key with ring finger and Alt key with middle finger on both hands. These fingers are much stronger than pinky and can endure frequent use.

Great tool for easily remapping keyboard keys on windows is AutoHotKey

On Ubuntu I managed to do it using: Keyboard Preferences / Layouts/ Other options

boskom
  • 840
  • 1
  • 7
  • 12
3

Per @Alasdair, remap Ctrl to "Caps Locks" or elsewhere: instructions for various platforms.

P.S. I'm a bit surprised this can't be done via an elisp function.

Chris Conway
  • 55,321
  • 43
  • 129
  • 155
3

Put the modifiers where they were meant to be: on either side of the space-bar, where they can be pressed by the thumb (or other digit of your choice) on the opposite hand from the digit pressing the modified letter (so that C-g is right-thumb on Ctrl and left index on 'g', and C-k is left-thumb on Ctrl and right middle on 'k'). You will note that the correct sequence, from inside out, is Ctrl Meta Super Hyper.

How you do this depends on your OS and your keyboard. For Windows, you might like to start here. In Mac OS X you can look in System Preferences > Keyboard & Mouse > Modifier Keys. For Linux, there are a thousand xmodmap and XKB tutorials.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user78171
  • 51
  • 2
  • Funny, my laptop has the ctrl key just about in the same spot (relative to the Z). The other modifiers go in towards the space bar, which is sized so as to leave room for convenient access to other functionality. – intuited Apr 20 '10 at 13:21
  • Yep, it's better to use thumbs. See also [my answer](http://stackoverflow.com/a/8935973/780703) for more. – teika kazura Mar 31 '12 at 08:29
2

Even after remapping capslock to become control, you still have to use your pinky to press it - at least I do, because my ring finger won't reach it for a command like C-g. Using your pinky at all is not recommended, right?

I'm on a MacBook Pro and I've just remapped the on the right side of the keyboard to become control. So that way, for instance, C-g becomes a keystroke I execute with both hands, my right-hand thumb on and my left forefinger on g.

We'll see if that helps with my RSI. Anyone else done this?

incandescentman
  • 6,168
  • 3
  • 46
  • 86
2

I have a MS natural keyboard as well and it's awesome. I've managed to train myself to use the side of my left hand (below the pinky) to hit the Ctrl key.

Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121
1

I am not a programmer and I also have a hard time explaining ideas. I am on a dell mini laptop. The mouse touchpad is in a spot where my thumbs rest. My left touchpad button acts as a control key: With the side of my thumb I press it and edit in emacs as usual. I was going to map the right touchpad button to alt, but instead I have done the following: I press the button and the control key gets pressed (locked). I press it again and controll gets released. This not only made my pinky feel better it also made my editing twice as fast. (according to my org-mode clocks) It is hard to explain how nice it works. In order to do this I used the following two aplications: xbindkeys xdotool My xbindkeys config file:

###########################
# xbindkeys configuration #
###########################
# left mouse button ctrl key
"xdotool keydown ctrl"
b:1
"xdotool keyup ctrl"
control + b:1  +  Release
# vi wanna be style editing
"xdotool keydown ctrl"
release+b:3
"xdotool keyup ctrl"
release+control+b:3
# -------------------------

Before experimenting with these ideas make sure to read the man pages. Do not have anything important open. I had to kill my window manager a few times before getting it correct. notes: I use xmodmap to do all the regular stuff i.e. caps ---> control (not a full solution), swapping alt and control. (on a laptop It is ok but my thumbs cramp up) I use the window manager config file (stumpwm) to create bindings to load the proper key mapping file. (depending on my mood for the day) I am sure all this can be implemented in a different environment. My pink pain is gone, my editing is faster.

1

Try the God-Mode plugin that is not bad .

Nishant
  • 20,354
  • 18
  • 69
  • 101
1

Since this thread is still kinda going, I'll add my two cents:

With or without emacs, the ctrl key is useful for tons of stuff on linux or windows: copy, cut, paste, find, close, quit... I use this stuff constantly. So as others have suggested, I want that near the spacebar so I can use my thumb. And that's how it is by default on a mac, where all that stuff uses the cmd key:

[ctrl] [alt] [cmd] [spacebar]

So, I use a mac keyboard on my linux box, and set up the cmd key as a second ctrl key (In Ubuntu Lucid: Keyboard Prefs > Layouts > Options > Alt/Win Key Behavior > Control is mapped to Win keys (and the usual Ctrl keys))

[ctrl] [alt] [ctrl] [spacebar]

Other benefits: * When I need to use a mac sometimes, cut/paste/etc are all in the same place I'm used to. * ctrl+tab (with the real ctrl key) still moves through tabs for browsers and other apps, on both platforms.

The drawback to this plan is that the alt key has moved to the left, so the alt+tab command (which I use for window switching) no longer matches the mac equivalent cmd+tab. But I can still hit it with my thumb, and it's still, to me, a far lesser evil than destroying my pinky. Yeah, I know I could just make ctrl+tab the window switcher, but then the real ctrl key doesn't work for tab switching. Besides, with apps moving into the browser, the window/tab navigational strategies are gonna be in flux for a while -- but the basics like cut/paste aren't going anywhere, so I want them locked down. Under my thumb.

(Of course, if you wanted to use emacs on a mac, I guess you'd be back at square one...)

rob
  • 337
  • 1
  • 4
  • 9
1

I actually did my own hack to avoid using the ctrl key. I use now the SPACEBAR key. This small program for X changes the behavior of the space bar, so that when it is used in a combination, it adds the control modifier to it. When used alone, it behaves normally on release. That way you don't have to use your pinky at all! Worked perfectly for me.

roadrunner
  • 11
  • 1
  • This program is still rudimentary, but can be a good alternative to my hack once it's refined enough. (See [my answer](http://stackoverflow.com/a/8935973/780703).) It's written in C++, but there's also an [implementation in C](https://github.com/baskerville/keydouble). I think it should work in Mac, too, while mine is limited to Xorg in Linux. – teika kazura Mar 31 '12 at 08:39
1

One of the first things I do on a new machine is remap Caps Lock to a new Control.

Google around, there are plenty of .reg files available that will do this painlessly for you on Windows.

gerikson
  • 283
  • 2
  • 6
1

I started using the side\palm of my hands to hit the control key instead of my pinky fingers. My understanding is that on more ergonomic keyboards the control key button is bigger which makes it easier to perform that motion.

Ray
  • 187,153
  • 97
  • 222
  • 204
1

I can use the Control key in either the west or south-west positions without any trouble. Many Emacsers swear that the control key belongs in the west position and the west position only, and that anything else will ruin your pinky. The only thing we know for sure causes RSI from typing is too much typing. Try type-break-mode and see if a few regular breaks help.

jfm3
  • 36,964
  • 10
  • 32
  • 35
1

Buy a Happy Hacking Keyboard which has Ctrl in The Right Place (Caps Lock is moved elsewhere). It has excellent response and is configurable via DIP switches for maximum integration on Mac, Windows, and Linux (for example, you can switch what is Alt and what is the Windows key right from the keyboard, no software required).

It also has a very small footprint, if that suits your fancy.

EfForEffort
  • 55,816
  • 4
  • 36
  • 41
0

Just to overcome this issue I remap all the copy,paste,save...etc into numpad.For further ease I bought a separate numpad and place it behind my laptop key board.

You can easily remap the keys using AHK(auto hot key).I am using the following key mappings 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
etc....

0

Assuming the key in the left lower corner of the keyboard is control (which is for standard keyboards), it's very easy to just lower your palm and it will press the Ctrl key. No pinky involved. It's so easy and fast I love it. I only use the pinky for the other keys above the Ctrl key (Shift, Caps, etc.). For Alt, Windows key, Function key (when using my laptop) on the left side I use my left thumb (right thumb for space). I use Ctrl the same way for combinations of hot keys that include Ctrl.

I only use right Left Ctrl key. I use Right Ctrl as "super" modifier (mapped to F23 in autohotkey which then is mapped to supper in emacs).

It may seem odd at first to press Ctrl this way but after some usage becomes super easy (it only requires a slight lowering of the hand/palm) - to me it's almost as easy as when no hotkey (Ctrl) is pressed. I see this difference as I'm now learning emacs and learning to do the same on the right side (for AppKey and Right Control key and Down and End for my laptop).

Here's my ahk code:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and      reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^#e:: Gosub, start_emacs
^#c:: Gosub, start_capture

#IfWinActive emacs@ ahk_class Emacs

Up::Return ; to not interfere with pressing <Down>

; F21 = Alt
RAlt::F21

; F23 = Super
RCtrl::F23

#IfWinActive

exit

start_emacs:
IfWinExist emacs@ ahk_class Emacs
    WinActivate
else
    Run c:\bin\emacs\bin\runemacs.exe
    WinMaximize
return

start_capture:
    Gosub, start_emacs
    SendInput {Ctrl down}xf{Ctrl up} {ctrl down}{shift down}{backspace}{ctrl up}{shift up}
    SendInput ~/org/capture.org {enter}
    SendInput {Alt down}x{Alt up} org-capture {enter}
return

Here's what I have in my .emacs:

                    ; prevent single key press from activating the given key
;; http://emacs.1067599.n5.nabble.com/w32-pass-rwindow-to-system-td144902.html
(setq w32-pass-lwindow-to-system nil
  w32-pass-rwindow-to-system nil
  w32-pass-apps-to-system nil)
                ; make sure the given key is not used as a modifier
(setq w32-lwindow-modifier nil
  w32-rwindow-modifier nil
  w32-apps-modifier nil) ; Menu/App key
                ; misc
(setq w32-recognize-altgr nil) ; C+M works: http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html
                ; A-alt
(define-key local-function-key-map (kbd "<f21>") 'event-apply-alt-modifier) ; RAlt in ahk
                ; H-hyper
(define-key local-function-key-map (kbd "<f22>") 'event-apply-hyper-modifier) 
(define-key local-function-key-map (kbd "<menu>") 'event-apply-hyper-modifier)
(define-key local-function-key-map (kbd "<apps>") 'event-apply-hyper-modifier) 
(define-key local-function-key-map (kbd "<lwindow>") 'event-apply-hyper-modifier)
(define-key local-function-key-map (kbd "<down>") 'event-apply-hyper-modifier)
                ; s-super
(define-key local-function-key-map (kbd "<f23>") 'event-apply-super-modifier) ; RCtrl in ahk
(define-key local-function-key-map (kbd "<right>") 'event-apply-super-modifier) 
(define-key local-function-key-map (kbd "<rwindow>") 'event-apply-super-modifier)
0

My Keyboard

enter image description here Just make a keyboard with short space key!

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
blackmiaool
  • 5,234
  • 2
  • 22
  • 39