Difference between revisions of "Ergonomics"

From WikEmacs
Jump to navigation Jump to search
Line 57: Line 57:
  
 
(require 'space-chord)
 
(require 'space-chord)
(space-chord-define-global "f" 'find-file) ; careful ! tweak to your liking
+
(space-chord-define-global "f" 'find-file) ; be careful ! Every time you're going to press space and 'f' OR 'f' and space quite simultaneously,
 +
; you'll invoke the find-file function. Tweak to your liking.
 
</source>
 
</source>
  

Revision as of 08:01, 15 May 2013

This page will focus on how to improve the ergonomy of Emacs. It can be just for convenience, or to avoid a Repetitive Strain Injury (RSI).

Tweaking Keyboard shortcuts

Emacs' shortcuts were designed for an old keyboard, where the alt and ctrl keys were at a different place from today ! My advice is you should take some time to modify the most used to your liking.

Make Caps Lock another Ctrl

that can be done with your desktop manager and it will save your left little finger.


Tweaking default functions' behaviour

Some actions triggered by a key may be incomplete. For example, when I press Enter, I'd like it to go to the next line AND to indent (that saves me a TAB press, and a lot each day). Do you like to type C-a C-k C-k to erase a line ?


Extensions

Keychord mode

Keychord gives the ability to map pairs of simultaneously pressed keys to commands. So you can define some keyboard shortcuts that do not involve Ctrl or Meta. (In this package, a "key chord" is two keys pressed simultaneously, or a single key quickly pressed twice (excluding Ctrl, Shift or Meta)).

Be careful, do not map two keys that usely go together, or it will be very inconvenient.

Installation

In Emacs 24, it is included in ELPA (or Marmelade repo ?), so :

M-x list-packages
then search for keychord, press 'i' to mark for installation and then 'x' to execute chosen actions.

In Emacs 23, you'll have to grab the sources and put in them in your load path.

Then, in both cases, add this to your dot-emacs :

	(require 'key-chord)
	(key-chord-mode 1)


and define some chords, for example

     (key-chord-define-global "'k" 'kill-buffer)

Space-chord

An extension of the above, to use the space key at an Emacs level. Again, be careful what pairs you chose as it can be very inconvenient.

Download the source in your load-path (i.e. .emacs.d/plugins/ ) and add the following in your .emacs :

(add-to-list 'load-path "~/.emacs.d/plugins/" )

(require 'space-chord)
(space-chord-define-global "f" 'find-file) ; be careful ! Every time you're going to press space and 'f' OR 'f' and space quite simultaneously,
; you'll invoke the find-file function. Tweak to your liking.

Avoid RSI, take a break !

Use Emacs built-in solutions or desktop-based.

M-x type-break-mode : launch counter. It will notify you to take a break. M-x type-break-statistics : see your stats.

Os-level : install rsibreak or others : https://en.wikipedia.org/wiki/List_of_repetitive_strain_injury_software


Choosing an appropriate keyboard

TypeMatrix

The TypeMatrx keyboard is thin, small, has its keys disposed as a matrix and, most of all, it has the Enter and the Backspace keys on the middle, so that you access them with your «second finger» of both hands. As a result, you stop moving your right wrist on a «big» distance to the right. This is known to be life saving (and my experience said that I can't work without a TypeMatrix).

Choosing a different keyboard layout

The Dvorak layout or the french version bépo are good choices. Take some weeks to learn them. You can use two configurations at the same time, it is like learning languages. I love bépo.

See the discussion about bépo on the french page.