This is a global minor mode for entering Emacs commands without
modifier keys. It's similar to Vim's separation of commands and
insertion mode. Activate for all buffers by running M-x god-mode
.
Toggle between God mode and non-God mode using ESC
:
(global-set-key (kbd "<escape>") 'god-local-mode)
This library defines the following mapping:
-
All commands are assumed to be
C-<something>
unless otherwise indicated. Examples:a
→C-a
s
→C-s
akny
→C-a C-k C-n C-y
xs
→C-x C-s
x s
→C-x s
Note the use of space to produce
C-x s
. -
g
is a special key to indicateM-<something>
. This means that there is no way to writeC-g
in this mode, you must therefore typeC-g
directly. Examples:gf
→M-f
gx
→M-x
-
G
is a special key to indicateC-M-<something>
. Example:Gx
→C-M-x
-
Digit arguments:
12f
→M-12 C-f
-
Repetition:
gfzz
→M-f M-f M-f
-
Universal boolean argument:
uco
→C-u C-c C-o
-
There is a key (default
i
- think insert) to disable God mode, similar to Vim's i.
If you do M-x god-mode
, then all buffers will be started in God
mode. If you don't like that behavior, just use the god-local-mode
toggler with a keybinding.
Sometimes god-mode
is enabled in buffers where it makes no sense. In
that case you can add the major mode to god-excempt-major-modes
:
(add-to-list 'god-excempt-major-modes 'dired-mode)
Since dired-mode
is already in the list, that's a noop, but you get
the idea. Consider opening an issue or pull request if you find a
major mode that should be on the official list.
- C- with backspace and arrow keys don't quite work, not looked into it yet.