Copyright (C) 2015-2019 David Capello
handy-mode is a progressive way to migrate your Emacs keyboard
bindings to a more friendly keyboard layout:
the handy layout.
It contains several levels to make it easy to go from the original
Emacs shortcuts to the new ones. The first handy level will give you
the most power with the less effort, it's really recommended to start
in this level.
You should start with the handy level one:
(add-to-list 'load-path "~/handy-mode")
(require 'handy-mode)
(setq handy-level 1)
(handy-mode 1)This will enable the Alt+JLIK keyboard shortcuts which can be
visualized as a set of arrow keys in a QWERTY keyboard where J is
the left arrow, L the right arrow, I the up arrow, and K the
down arrow, just like this graph:
.-----.
| I |
.-----'-----'-----.
| J | K | L |
'-----------------'
In this level, Alt+JLIK will be associated to these commands:
M-j:backward-charM-l:forward-charM-i:previous-lineM-k:next-line
And Alt+Shift+JLIK to:
M-J:backward-sexpM-L:forward-sexpM-I:scroll-down-commandM-K:scroll-up-command
We offer some alternatives to the Emacs commands associated with these overriden keybindings:
:M-jindent-new-comment-line, useESC M-jinstead:M-ldowncase-word, useESC M-linstead:M-itab-to-tab-stop, useESC M-iinstead:M-kkill-sentence, useESC M-kinstead
If you learn these new shortcuts, you will already be able to replace a big chunk of ackward Emacs keyboard shortcuts. After you get used to these keys, you can forgot the old keybindings:
:C-bbackward-charnow isM-j:C-fforward-charnow isM-l:C-pprevious-linenow isM-i:C-nnext-linenow isM-k:C-M-bbackward-sexpnow isM-J:C-M-fforward-sexpnow isM-L:M-vscroll-down-commandnow isM-I:C-vscroll-up-commandnow isM-K
This mode is defined in handy-mode-jlik.el file.
(add-to-list 'load-path "~/handy-mode")
(require 'handy-mode)
(setq handy-level 2)
(handy-mode 1)The Level 2 NM enables the Alt+M prefix which opens a lot of new
commands.
.-----.
| |
.-----' '-----.
| |
.-----|-----------------'
| N | M |
'-----------'
This prefix will be used in next levels to replace overriden Emacs shortcuts. You can learn the prefixed commands progressively, the most important ones at this moment are:
-
M-n:handy-keyboard-quit(likeC-g) -
M-m: prefix -
M-M:execute-extended-command -
M-m h:back-to-indentation -
M-m c:handy-change-case(a way to replacedowncase-word/upcase-word/capitalize-wordwith one command)
Overriden shortcuts:
:M-mback-to-indentation, useM-m hinstead: this one was introduced to replace the oldESC M-l(M-ldowncase-word), now you can useM-m c k
Get used to the new M-M so you don't have to use M-x to execute
commands in the future (execute-extended-command).
This level is defined in handy-mode-nm.el file.
(add-to-list 'load-path "~/handy-mode")
(require 'handy-mode)
(setq handy-level 3)
(handy-mode 1)Enables Alt+UO keys to jump between words or paragraphs (or
functions on progmodes):
.-----.-----.-----.
| U | | O |
|-----' '-----|
| |
.-----|-----------------'
| | |
'-----------'
New ways to jump between words and paragraphs/functions:
M-u:backward-wordM-o:forward-wordM-U:handy-beginning-of-block(backward-paragraph/beginning-of-defun)M-O:handy-end-of-block(forward-paragraph/end-of-defun)
Overridden keybindings:
:M-uupcase-word, you can useM-m c ifromhandy-mode-nm:M-ofacemenu-set-face, you can useM-m M-Ofromhandy-mode-nm
You can forgot about:
:M-fbackward-wordnow isM-u:M-bforward-wordnow isM-o:M-{backward-paragraphnow isM-Uin textmodes:M-}forward-paragraphnow isM-Oin textmodes:M-{beginning-of-defunnow isM-Uin progmodes:M-}end-of-defunnow isM-Oin progmodes
This level is defined in handy-mode-uo.el file.
.-----.-----.-----.
| | | |
|-----' '-----|
| |
.-----------------------------.-----'-----------------'
| Z X C V B | |
'-----------. '-----------|
| SPC |
'-----------------------------'
This level is defined in handy-mode-zb.el file.
.-----.-----.-----.-----.
| Y | | | |
| |-----' '-----|
| H | |
.-----------------------------|-----'-----------------'
| | |
'-----------. '-----------|
| |
'-----------------------------'
This level is defined in handy-mode-yh.el file.
.-----------------. .-----.-----.-----.-----.
| W E R | | | | | |
'-----. '-----| |-----' '-----|
| D F G | | |
.-----------'-----------------|-----'-----------------'
| | |
'-----------. '-----------|
| |
'-----------------------------'
This level is defined in handy-mode-werd.el file.
This level is defined in handy-mode-modal.el
file. Pressing M-p you can lock the Alt key so there is no need
to press M- modifier for keyboard shortcuts in all other modes.
This is still a work-in-progress, doesn't work in several modes inside the minibuffer, etc.
This is recommended only when you already know about all the
handy-mode keyboard shortcuts:
(add-to-list 'load-path "~/handy-mode")
(require 'handy-mode)
(handy-mode 1)Distributed under the MIT license.