ErgoEmacs Keybinding Features

By Xah Lee. Date: . Last updated: .

Note: This page is obsolete. The new ergoemacs-mode page is at: http://ergoemacs.github.io/

Standard Shortcuts

The following standard shortcuts are supported.

Standard nameKey pressEmacs command name
Open New FileCtrl+nnew-empty-buffer
OpenCtrl+ofind-file
Open in DesktopCtrl+Shift+oopen-in-desktop
Open Last ClosedCtrl+Shift+topen-last-closed
CloseCtrl+wclose-current-buffer
SaveCtrl+ssave-buffer
Save AsCtrl+Shift+swrite-file
PrintCtrl+pprint-buffer-confirm
Select AllCtrl+amark-whole-buffer
FindCtrl+fsearch-forward

The command new-empty-bufferCtrl+n】 lets you open new scratch buffers easily. New buffers are named “untitled”, “untitled<2>”, “untitled<3>”, etc.

The new command close-current-bufferCtrl+w】 will prompt you for save when you close a modified buffer. (Rational: Emacs: Problems of the Scratch Buffer.)

Copy Cut Paste Undo Redo

Standard nameKey pressEmacs comand name
CopyAlt+ckill-ring-save
CutAlt+xkill-region
PasteAlt+vyank
UndoAlt+zundo
RedoAlt+Shift+zredo

If you also want these commands with the Ctrl, you need to have cua mode on. Place this in your emacs init file: (cua-mode 1).

When there is no text selection, copy will copy the current line. Same for cut.

Window/Tab Switching

The following are some new commands that lets you easily switch windows or buffers.

Window-Switching Shortcuts
Standard nameKey pressEmacs command name
Next WindowAlt+`switch-to-next-frame
Previous WindowAlt+~switch-to-previous-frame
Next TabCtrl+Page Downnext-user-buffer
Previous TabCtrl+Page Upprevious-user-buffer
Ctrl+Shift+Page Downnext-emacs-buffer
Ctrl+Shift+Page Upprevious-emacs-buffer

shrink-whitespaces, compact/uncompact-block, toggle-letter-case

The following are new commands that combine the functionality of several similar commands into one. This way, you have one single command with one single shortcut to remember. They do what you want depending on context.

New Commands
NameShortcutDescription
shrink-whitespacesAlt+wCalls either just-one-space or delete-blank-lines depending on context of neighbor text around cursor.
compact-uncompact-blockAlt+qCalls one of {fill-paragraph, fill-region, or “unfill-paragraph”, “unfill-region”}, depending on context. (tech detail)
toggle-letter-caseAlt+/Toggles letter case of current word or region. It combines capitalize-word, downcase-word, upcase-word, capitalize-region, downcase-region, “upcase-region.” (tech detail)

Support for International Layouts

ErgoEmacs Keybinding support the following keyboard layouts:

For graphic illustration of these layouts, see: Keyboard layouts. For ergonomic variants for different languages, see: Alternative Keyboard Layouts.

Displaced Commands

The following table are commands that has a default keybinding with Alt key in GNU Emacs, but are statistically not often used. They no longer have a keyboard shortcut.

Displaced Commands
Emacs CommnandsQwertyDvorak
Cursor Moving
backward-sentenceAlt+a
forward-sentenceAlt+e
move-to-window-lineAlt+r
center-lineAlt+s
Text Changing
kill-sentenceAlt+k
zap-to-charAlt+z
indent-new-comment-lineAlt+j
transpose-wordsAlt+tremain
Other
facemenu prefix 【Alt+g
eval-expressionAlt+:
ispell-wordAlt+$
abbrev-prefix-markAlt+-remain
tmm-menubarAlt+'
find-tagAlt+.remain
tags-loop-continueAlt+,remain
tab-to-tab-stopAlt+i
dabbrev-expandAlt+/remain

If you use these commands often, you can define keys for them. You can use the 【Ctrl+‹key›】 space because there are a lot empty space there now. For how to define your own keybindings, see: Emacs: How to Define Keys.

Notes for Windows and Mac

Windows Users

On Microsoft Windows, 【Ctrl+Shift】 or some other combination may switch your Input Language or Keyboard Layout. You can disable this, or change the shortcut to something else. Go to your Windows Control panel, keyboards, Advanced Key Settings tab, then press the button “Change Key Sequence…”. (This describes Windows Vista. Window XP and Windows 7 should be similar.)

See also: Disable Ctrl+Alt+S Shortcut for HP Support Information, PC Doctor.

Mac Users

On Mac OS X, 【⌘ command+h】 is Hide and 【⌘ command+Shift+q】 is Log Out. If your Meta is ⌘ command, then the Mac behavior will not be available because ErgoEmacs uses these keys. If you wish to have the Mac behavior, put the following in your emacs init file:

(setq mac-pass-command-to-system t)

This works for Carbon Emacs. It may not work for plain GNU Emacs compiled for the Mac.

Adoption Tips

If you are a long time emacs user, you may find it painful to adopt this setup. This difficulty is nothing special. It's the same difficulty when you switching to Dvorak after years of QWERTY, or switching to Mac after years of Windows. Basically, it's about changing muscle memory.

where-is-old-binding

The ergoemacs-mode minor mode features the command where-is-old-bindingCtrl+h o】. This command asks you to type a shortcut, and tells you what command it was bound in emacs default, and the new shortcut for it under ErgoEmacs.

For some tips and elisp code for gradual adoption, see: http://code.google.com/p/ergoemacs/wiki/adoption.

Better Shortcut Layout vs Better Key Layout

On the subject of keyboarding ergonomics, you may wonder if switching from QWERTY to Dvorak provides a better improvement than switching from a lousy to better keyboard shortcut layout. (suppose you chose only one.)

Of my Emacs Commands Frequency study, 43% of key strokes are typing and pressing return (data entry), while the rest 57% are calling all other emacs commands (for example: moving cursor, deleting chars/words/sentences, formatting, and any emacs command that is not plain typing). This seems counter-intuitive, because one might think typing should probably be the bulk of activity and moving cursor and deleting text or other commands are only done few times per minute.

This data suggests that, in editing tasks for programing, a better shortcut placement is probably more important than better placement of letter keys.

Questions?

For any questions, suggestions, discussions, or announcement of new version, please post or subscribe at http://groups.google.com/group/ergoemacs.

For defect report, enhancement suggestions, please post a issue at http://code.google.com/p/ergoemacs/issues/list. Currently, there is one defect. When working in text terminal, the arrows keys do not work. You have to use {【Alt+i】, 【Alt+k】, 【Alt+j】, 【Alt+l】} instead. 〔►see issue 37

Liket it? Put $5 at patreon. Or Buy Xah Emacs Tutorial. Thanks.