2016-11-04 13:47:40 +01:00
|
|
|
[](https://travis-ci.org/jyp/boon)
|
|
|
|
[](https://melpa.org/#/boon)
|
|
|
|
[](http://stable.melpa.org/#/boon)
|
2016-11-04 13:43:33 +01:00
|
|
|
|
2014-10-24 23:04:32 +02:00
|
|
|
Boon: An Ergonomic Command Mode for Emacs
|
|
|
|
==========================================
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
Boon is a complete package for modal editing, which is not Evil.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-11-04 14:07:55 +01:00
|
|
|
Selling points:
|
|
|
|
- Ergonomic: common commands are easy to type. (See below)
|
|
|
|
- Lightweight: ~300 loc for its core.
|
2016-09-17 15:57:16 +02:00
|
|
|
- Good Emacs integration: integrates well with existing Emacs
|
2016-08-31 21:58:55 +02:00
|
|
|
infrastructure and takes advantage of it.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
Ergonomic Design
|
|
|
|
----------------
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-20 22:44:58 +02:00
|
|
|
It is largely accepted that modal edition is more ergonomic than using
|
2016-08-31 21:58:55 +02:00
|
|
|
key-chords. Boon attempts to make modal editing as comfortable as
|
2014-10-20 22:44:58 +02:00
|
|
|
possible, by adhering to the following design principles:
|
|
|
|
|
|
|
|
- Spacial allocation first, mnemonics second: the allocation of keys
|
2016-09-17 15:57:16 +02:00
|
|
|
to commands is primarily based on the locations of keys on the
|
2014-10-26 12:31:08 +01:00
|
|
|
keyboard. Whatever is printed on the key cap is a secondary concern.
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2016-09-17 15:57:16 +02:00
|
|
|
- Easy finger rolls: common key combinations should either be
|
|
|
|
left/right hand alternation or easy one-hand rolls.
|
2014-10-20 22:44:58 +02:00
|
|
|
|
|
|
|
- Use of home row and strong fingers for the most used commands
|
|
|
|
|
|
|
|
- Easy navigation: many commands are bound to navigation. This
|
2016-09-17 15:57:16 +02:00
|
|
|
allocation of keys facilitates moving around, which is the most
|
|
|
|
common task when editting text. Because movements double up as
|
2016-09-04 22:20:07 +02:00
|
|
|
region-definitions, this design also makes manipulation commands
|
|
|
|
more powerful.
|
|
|
|
|
2016-09-17 15:57:16 +02:00
|
|
|
- Prefer an easy two-keystroke combination to a single hard-to-reach
|
|
|
|
key. Hard-to-reach keys are free for the user to bind to rarely used
|
|
|
|
commands (often user and mode-dependenent).
|
2014-10-20 22:44:58 +02:00
|
|
|
|
|
|
|
In command mode, movement keys are bound to the right hand, while text
|
|
|
|
manipulation is bound to the left hand.
|
|
|
|
|
|
|
|
|
|
|
|
Right-hand.
|
|
|
|
|
|
|
|
The leftwards (and upwards) movements are bound to the leftmost
|
|
|
|
fingers (index and middle finger), while rightwards (and downwards)
|
|
|
|
movements are bound to the rightmost fingers (ring finger and pinky.)
|
2016-09-17 15:57:16 +02:00
|
|
|
Additional unpaired, movements are bound to the middle column
|
|
|
|
(extended reach with index).
|
2014-10-20 22:44:58 +02:00
|
|
|
|
|
|
|
Left-hand.
|
|
|
|
|
|
|
|
The most common edition commands (cut, paste, parenthesis
|
|
|
|
manipulation) are bound to the home row. The top row is (mainly) for
|
2014-10-26 12:31:08 +01:00
|
|
|
searching. The bottom row gives access to regular Emacs stuff (C-x
|
2016-09-17 15:57:16 +02:00
|
|
|
...) (C-c ...), insert mode, and registers.
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
|
|
|
|
Emacs Integration: Reusable Modules
|
|
|
|
-----------------------------------
|
|
|
|
|
2016-09-04 22:20:07 +02:00
|
|
|
Boon is designed as a stack of layers. Each layer is customizable and
|
2016-09-17 15:57:16 +02:00
|
|
|
provides reusable components, in full agreement with the Emacs
|
|
|
|
spirit. This means that even if you disagree with the design choices
|
2016-09-04 22:20:07 +02:00
|
|
|
explained above, you may still want to use some parts of Boon. The
|
2016-09-01 20:49:33 +02:00
|
|
|
structure of Boon is as follows:
|
2016-08-31 21:58:55 +02:00
|
|
|
|
2016-09-17 15:57:16 +02:00
|
|
|
1. boon-moves.el and boon-search.el provide a set of move and search
|
|
|
|
commands. These work the same way as standard Emacs commands ---
|
|
|
|
they are merely (sometimes) more powerful. Frontends typically bind
|
|
|
|
these commands (and more) in boon-moves-map, which is active in
|
|
|
|
'command mode'.
|
|
|
|
2. boon-arguments.el provides a set of selectors to define
|
|
|
|
regions. (These selectors are the equivalent of vim 'text
|
|
|
|
objects'.) Selectors include plain regions (words, lines,
|
|
|
|
paragraphs, ...), but also region transformers (think: exclude
|
|
|
|
borders, just borders, including spaces, foreach,
|
|
|
|
etc.). Additionally every move command in the boon-moves-map keymap
|
|
|
|
can be used as a selector. The selectors are regular interactive
|
|
|
|
functions, which means that they are easily customized. On top of
|
|
|
|
it all, the system supports multiple-cursors (multiple regions will
|
|
|
|
be returned when multiple cursors are active).
|
|
|
|
3. boon-core.el provides an infrastructure for modal editing. The
|
|
|
|
implementation is very much inspired from evil-core, but heavily
|
|
|
|
simplified.
|
|
|
|
4. boon-main.el provides a set of commands. These are similar to
|
|
|
|
standard Emacs commands, but they use the system of selectors
|
|
|
|
described above. (For good measure, some random extra commands are
|
|
|
|
thrown in.) These commands may be used in combination with a modal
|
|
|
|
system or not. A few commands also switch to insert mode.
|
|
|
|
5. boon-keys.el, boon-colemak.el, boon-qwerty.el are frontends. Those
|
|
|
|
require all the above and provide a mapping of moves, selectors and
|
|
|
|
commands onto keys.
|
2016-08-31 21:58:55 +02:00
|
|
|
|
2016-09-04 21:42:27 +02:00
|
|
|
Installation
|
|
|
|
------------
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2014-10-23 09:54:14 +02:00
|
|
|
REQUIREMENTS
|
2015-11-19 11:30:06 +09:00
|
|
|
- Emacs version >= 24.5
|
2016-09-04 22:20:07 +02:00
|
|
|
- Qwerty or Colemak layout (workman version partially implemented).
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2014-10-26 12:31:08 +01:00
|
|
|
Install Boon (perhaps using
|
2014-11-03 09:22:44 +01:00
|
|
|
[](http://stable.melpa.org/#/boon)),
|
2014-10-24 21:16:16 +02:00
|
|
|
and add the following to your configuration:
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
(require 'boon-colemak)
|
|
|
|
;; (require 'boon-qwerty) ;; for qwerty port (alpha quality)
|
2016-10-14 08:42:10 +02:00
|
|
|
(require 'boon-powerline)
|
2016-08-31 21:58:55 +02:00
|
|
|
(boon-powerline-theme) ;; if you want use powerline with Boon
|
2016-09-04 21:42:27 +02:00
|
|
|
|
|
|
|
Then
|
|
|
|
|
|
|
|
(boon-mode) ;; to enable boon everywhere
|
|
|
|
|
|
|
|
If you just eval'ed the above (or just did not want to enable boon
|
2016-09-04 22:20:07 +02:00
|
|
|
everywhere), Boon may not be active in the current buffer. If it is
|
|
|
|
not activated and you want to try it locally, activate it by
|
2016-09-04 21:42:27 +02:00
|
|
|
|
|
|
|
M-x turn-on-boon-mode
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-24 22:47:09 +02:00
|
|
|
You can jump-start by reading the
|
2014-11-03 09:15:55 +01:00
|
|
|
[cheat sheet](https://pdf.yt/d/hSKUThNNSxrNFXkQ) directly, but reading
|
2016-09-04 21:42:27 +02:00
|
|
|
through the tutorial is highly recommended:
|
|
|
|
|
|
|
|
M-x boon-tutorial
|
|
|
|
|
|
|
|
(You'll get the version of the tutorial adapted to the frontend you
|
2016-09-17 15:57:16 +02:00
|
|
|
have activated, qwerty or colemak.)
|
2016-09-04 21:42:27 +02:00
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The main variables to configure are:
|
2014-10-20 22:44:58 +02:00
|
|
|
|
2016-09-17 15:57:16 +02:00
|
|
|
- boon-select-map, boon-moves-map, boon-command-map. Those are keymaps.
|
|
|
|
- boon-enclosures, which can be customized.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-26 12:31:08 +01:00
|
|
|
Comparison with other modal layers for Emacs
|
2014-10-20 22:44:58 +02:00
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
- Evil
|
|
|
|
|
2014-10-26 12:31:08 +01:00
|
|
|
Evil is a (quite) complete vi emulation layer for Emacs.
|
2014-10-24 22:54:56 +02:00
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
In Boon, quite a bit of Emacs structure and user experience is
|
|
|
|
retained. Examples: the x key gives the C-x prefix map. The usual
|
|
|
|
Emacs (interactive) arguments are used for text objects. Thus most of
|
|
|
|
Boon remains usable even if one does not wish to use modal editing.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-24 22:54:56 +02:00
|
|
|
Besides, Emacs is already customizable enough as it is: the core of
|
2016-08-31 21:58:55 +02:00
|
|
|
Boon is just 300 lines or so. Figuring out all the ins and outs of
|
|
|
|
Evil to do what I want would probably have required more effort than
|
|
|
|
implementing Boon.
|
|
|
|
|
|
|
|
Finally, evil use vi bindings (by default at least), which do not
|
|
|
|
feature the best ergonomics.
|
|
|
|
|
2016-09-08 13:48:42 +02:00
|
|
|
- Xah Fly Keys http://ergoemacs.org/misc/ergoemacs_vi_mode.html
|
|
|
|
|
|
|
|
Like boon, Xah Fly Keys aims at providing a layout whose design is
|
|
|
|
ergonomic. As far as I understand it follows the spirit of Xah's
|
|
|
|
ErgoEmacs package. As I understand it ErgoEmacs makes most design
|
|
|
|
decisions differently from boon. I have not made an in-depth
|
|
|
|
comparison of ergonomics yet.
|
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
- Fingers https://github.com/fgeller/fingers.el
|
|
|
|
|
2016-09-17 15:57:16 +02:00
|
|
|
Fingers borrows a few ideas from Boon, including the division of
|
|
|
|
work between left and right hand. fgeller gives a detailed account
|
|
|
|
of the particular differences with Boon. My opinion is that Fingers
|
|
|
|
is compatible with Boon concepts and could (and probably should) be
|
|
|
|
implemented as a Boon 'frontend'.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-20 22:44:58 +02:00
|
|
|
- God-mode https://github.com/chrisdone/god-mode
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-24 22:54:56 +02:00
|
|
|
God-mode is similar to "sticky modifier keys" in principle. Its
|
|
|
|
simplicity allows to quickly get up to speed with it. However, it
|
|
|
|
lacks the main benefit of a true modal layer: text operators. (what
|
|
|
|
vi fans call a "language for text edition").
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-20 22:44:58 +02:00
|
|
|
- Modal Mode http://retroj.net/modal-mode
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2016-08-31 21:58:55 +02:00
|
|
|
Another modal layer for Emacs, which is also lightweight and aims to
|
|
|
|
integrate with Emacs. However, as far as I can see, there is no
|
2016-09-17 15:57:16 +02:00
|
|
|
special attention paid to ergonomics.
|
2014-10-20 14:25:43 +02:00
|
|
|
|
2014-10-20 22:44:58 +02:00
|
|
|
- Modal Emacs https://github.com/joelmccracken/modal-emacs
|
2014-10-18 22:03:14 +02:00
|
|
|
|
2014-10-24 22:54:56 +02:00
|
|
|
Modal Emacs does not appear to be complete.
|
2016-08-31 21:58:55 +02:00
|
|
|
|