Home

Awesome

Introduction to handy

by David Capello

What is handy?

handy (or handy-mode) is a set of keyboard shortcuts that you could use in any text editor. The idea is to offer a progressive way to convert your current keyboard shortcuts to a more easy to use set of shortcuts.

handy offers:

  1. Simple cursor movements using the Alt modifier and the home row
  2. A progressive path of change to incorporate new keyshortcuts step by step
  3. And as a final stage, you will be able to use a modal mode (vim-like mode) where the same shortcuts are accesible without pressing Alt modifier all the time

It's focused on Emacs, but you could configure other text editors and shells:

Motivation

Ten years ago (2009~2010) I started experiencing the Emacs pinky problem. Luckily, I've found a great project by Xah Lee: ErgoEmacs. This was the beginning of a journey to re-learn all Emacs keyboard shortcuts, and learning several good UX improvements like grouping several Emacs commands in one keystroke or repetitive keystrokes.

After modifying ErgoEmacs for my own purposes, I decided to create a text editor with these shortcuts, but it was a failed attempt (as it requires too much work/free-time to finish it). So then the project changed to a more realistic approach: create a progressive set of shortcuts to switch to handy from any text editor (Emacs in the first place).

I'll try to include in this document the imagery that is on my own head when I use handy, that will be helpful for new users to adopt the new shortcuts.

Keyboard Layout

This is the progressive set of levels that you will learn:

Level 1 JLIK

In the first level of handy, we have: Alt+J, Alt+L, Alt+I, Alt+K:

      .-----.
      |  I  |
.-----'-----'-----.
|  J  |  K  |  L  |
'-----------------'

This set of keys simulate the arrow keys of any keyboard but they are located in the home row mainly (JKL) so you don't have to move your hand to move the cursor:

With the Shift modifier, steps get a little wider:

What is a balanced expression? It can be anything that is balanced in the actual programming language. For example, on mathematical expression, it should jump between (...)

x= ( (a+2)  * y -  (5*z) )
    ^-----^       ^-----^
  ^----------------------^

On programming languages it should jump between balanced strings limits "...", scopes {...}, array indexer [...], etc. When none of these characters are found, it should move just through words.

Level 2 NM

            .-----.
            |     |
      .-----'     '-----.
      |                 |
.-----'-----------------'
|  N     M  |
'-----------'

The second handy level enables the prefix key to open an huge range of commands, and to cancel actions/commands:

List of Alt+M, ... commands:

Commands about macros:

Commands about bookmarks:

Commands about registers:

Level 3 UO

      .-----.-----.-----.
      |  U  |     |  O  |
      |-----'     '-----|
      |                 |
.-----'-----------------'
|           |
'-----------'

Level 4 ZB

                                    .-----.-----.-----.
                                    |     |     |     |
                                    |-----'     '-----|
                                    |                 |
.-----------------------------.-----'-----------------'
|  Z     X     C     V     B  |           |
'-----------.                 '-----------|
            |             SPC             |
            '-----------------------------'

...

Level 5 YH

                              .-----.-----.-----.-----.
                              |  Y  |     |     |     |
                              |     |-----'     '-----|
                              |  H  |                 |
.-----------------------------|-----'-----------------'
|                             |           |
'-----------.                 '-----------|
            |                             |
            '-----------------------------'

...

Level 6 WERD

      .-----------------.     .-----.-----.-----.-----.
      |  W     E     R  |     |     |     |     |     |
      '-----.           '-----|     |-----'     '-----|
            |  D     F     G  |     |                 |
.-----------'-----------------|-----'-----------------'
|                             |           |
'-----------.                 '-----------|
            |                             |
            '-----------------------------'

...

Level 7 Modal

In this mode you have just one new keyboard shortcut available: Alt+P

Pressing Alt+P you lock the Alt key prefix for all other levels, so the first Alt is not necessary to be pressed. Pressing Alt+P again you disable the lock and you're back to the normal editing mode (where Alt modifier is required to execute the regular commands in all other levels).

The idea of Alt+P is that depending on what you need to do you can lock the Alt key (for navigation) or unlock it (for editing).

Text Editors

How to configure each text editor?

Acknowledges

handy is based on ideas from: