ErgoEmacs Keybinding Features

By Xah Lee. Date: . Last updated: .

Note: This page is obsolete. The new ergoemacs-mode page is at:

Standard Shortcuts

The following standard shortcuts are supported.

Standard nameKey pressEmacs command name
Open New FileCtrl+nnew-empty-buffer
Open in DesktopCtrl+⇧ Shift+oopen-in-desktop
Open Last ClosedCtrl+⇧ Shift+topen-last-closed
Save AsCtrl+⇧ Shift+swrite-file
Select AllCtrl+amark-whole-buffer

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
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
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
Text Changing
facemenu prefix 【Alt+g

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.


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:

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.


For any questions, suggestions, discussions, or announcement of new version, please post or subscribe at

For defect report, enhancement suggestions, please post a issue at 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

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from Best Keyboard for Emacs