ErgoEmacs Keybinding Features
2012-04-07 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 name | Key press | Emacs command name |
---|---|---|
Open New File | Ctrl+n | new-empty-buffer |
Open | Ctrl+o | find-file |
Open in Desktop | Ctrl+Shift+o | open-in-desktop |
Open Last Closed | Ctrl+Shift+t | open-last-closed |
Close | Ctrl+w | close-current-buffer |
Save | Ctrl+s | save-buffer |
Save As | Ctrl+Shift+s | write-file |
Ctrl+p | print-buffer-confirm | |
Select All | Ctrl+a | mark-whole-buffer |
Find | Ctrl+f | search-forward |
The command new-empty-buffer
【Ctrl+n】 lets you open new scratch buffers easily. New buffers are named “untitled”, “untitled<2>”, “untitled<3>”, etc.
The new command close-current-buffer
【Ctrl+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 name | Key press | Emacs comand name |
---|---|---|
Copy | Alt+c | kill-ring-save |
Cut | Alt+x | kill-region |
Paste | Alt+v | yank |
Undo | Alt+z | undo |
Redo | Alt+Shift+z | redo |
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.
Standard name | Key press | Emacs command name |
---|---|---|
Next Window | Alt+` | switch-to-next-frame |
Previous Window | Alt+~ | switch-to-previous-frame |
Next Tab | Ctrl+PageDown | next-user-buffer |
Previous Tab | Ctrl+PageUp | previous-user-buffer |
◇ | Ctrl+Shift+PageDown | next-emacs-buffer |
◇ | Ctrl+Shift+PageUp | previous-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.
Name | Shortcut | Description |
---|---|---|
shrink-whitespaces | Alt+w | Calls either just-one-space or delete-blank-lines depending on context of neighbor text around cursor. |
compact-uncompact-block | Alt+q | Calls one of {fill-paragraph , fill-region , or “unfill-paragraph”, “unfill-region”}, depending on context. (tech detail) |
toggle-letter-case | Alt+/ | 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:
- US
- US Dvorak (ergonomic)
- UK
- UK Dvorak (ergonomic)
- Spanish (Spain) (aka “Spanish (International sort)”)
- Italian
- Swedish
- Colemak (ergonomic)
- pt-nativo (ergonomic for Portuguese)
For graphic illustration of these layouts, see: Keyboard layouts. For ergonomic variants for different languages, see: Ergonomic 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.
Emacs Commnands | Qwerty | Dvorak |
---|---|---|
Cursor Moving | ||
backward-sentence 【Alt+a】 | ✗ | ✗ |
forward-sentence 【Alt+e】 | ✗ | ✗ |
move-to-window-line 【Alt+r】 | ✗ | ✗ |
center-line 【Alt+s】 | ✗ | ✗ |
Text Changing | ||
kill-sentence 【Alt+k】 | ✗ | ✗ |
zap-to-char 【Alt+z】 | ✗ | ✗ |
indent-new-comment-line 【Alt+j】 | ✗ | ✗ |
transpose-words 【Alt+t】 | remain | ✗ |
Other | ||
facemenu prefix Alt+g | ✗ | ✗ |
eval-expression 【Alt+:】 | ✗ | ✗ |
ispell-word 【Alt+$】 | ✗ | ✗ |
abbrev-prefix-mark 【Alt+-】 | remain | ✗ |
tmm-menubar 【Alt+'】 | ✗ | ✗ |
find-tag 【Alt+.】 | remain | ✗ |
tags-loop-continue 【Alt+,】 | remain | ✗ |
tab-to-tab-stop 【Alt+i】 | ✗ | ✗ |
dabbrev-expand 【Alt+/】 | ✗ | 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: Define Keybinding.
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 Info.
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-binding
【Ctrl+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]