Emacs: Xah Fly Keys

By Xah Lee. Date: . Last updated: .

What is Xah Fly Keys

Xah Fly Keys is more efficient than vim, or any keybinding set in history.

xah-fly-keys.el is a modal editing mode for emacs, like vi, but the design of key/command choice is based on command frequency statistics and ease-of-key score. Most frequently used commands have most easy keys.

If you have hand pain from using emacs, consider using Xah Fly Keys. Never need to press Ctrl+x and never need to press Meta anymore.

xah fly keys kinesis 2017 09 60363
Xah Fly Keys and Kinesis keyboard, from a friend

Video Intro to Xah Fly Keys

Xah Talk Show 2023-10-25 Xah Fly Keys, Bill Gosper Equations, Game of Life

more videos of Xah Fly Keys:

Download

Archived Old Versions

Install from NonGNU ELPA

Alt+x package-install RET xah-fly-keys RET

http://elpa.nongnu.org/nongnu/xah-fly-keys.html

Manual Install

Put the file xah-fly-keys.el in ~/.emacs.d/lisp/

Put the following in your emacs init:

(add-to-list 'load-path "~/.emacs.d/lisp/")

(require 'xah-fly-keys)

;; specify a layout. optional
(xah-fly-keys-set-layout "qwerty")
;; (xah-fly-keys-set-layout "dvorak")

;; possible values

;; adnw (German)
;; azerty
;; azerty-be
;; bepo (French)
;; colemak
;; colemak-dh
;; dvorak
;; engrammer
;; halmak
;; koy (German)
;; minimak
;; neo2 (German)
;; norman
;; programer-dvorak
;; pt-nativo (Brazil)
;; qfmlwy
;; qwerty
;; qwerty-abnt (Brazil)
;; qwerty-no (Norwegian)
;; qwertz
;; qwpr
;; russian
;; workman

(xah-fly-keys 1)

What Does Command Mode Do?

When in command mode:

1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z , . ' \ / = - [ ] ; ` Xah Fly Keys command mode layout other-frame unsplit split Select¶ S Line S w S (▮) M-x ⌫() insert ⌦|¶ ←|¶ →|¶ ⌦w format ⌫␣ ⌫w mark undo →w ←w Case search paste cut copy cmt ←( →) →() next◫ leader key Cmd Mode

Activate Command Mode

Alt+x xah-fly-command-mode-activate
Activates command mode.

By default, it has the following keys:

  • Alt+Space
  • Ctrl+Space
  • Home
  • F8
  • Escape (only when emacs running in graphical user interface, not in terminal)
  • ▤ Menu (Keyboard Menu Key)

Visual Indicator for Command Mode

When in command mode, the cursor shape is a black rectangle ▮ (Does not work in some text terminal), and the first character in emacs status bar (aka mode line) displays lowercase c.

Xah Fly Keys command mode 2024-04-23 qZ3
Xah Fly Keys command mode 2024-04-23 qZ3

How to Find Out What a Key Do in Command Mode

To find the command name of a key, switch to command mode , then 【Space j v 】 (describe-key) , then press the key. (try it now, as you will do this frequently when learning.)

Insert Mode

When in insert mode, keys insert characters. It is essentially like Xah Fly Keys is off. (in some emacs major modes, letter key may do something special, e.g. in dired, m marks a file.)

Alt+x xah-fly-insert-mode-activate
Activate insert mode.

When in command mode, f activates insertion mode.

When in command mode, Space Space also activates insertion mode.

Visual Indicator for Insertion Mode

When in insert mode, the cursor shape is a I-beam ⌶ (does not work in some text terminal) and the first character in emacs status bar (aka mode line) displays i.

Xah Fly Keys insert mode 2024-04-23 2YB
Xah Fly Keys insert mode 2024-04-23 2YB

Leader Key Sequence for Commands

You NEVER need to press Ctrl+x

When in command mode, the Space is the leader key. It begins a key sequence for all commonly used commands.

Here's example of frequently used ones.

There are about 200 commands with leader key sequence. Most frequently used commands have 2 keys (counting the leader key). Other commands have 3 keys. Some rarely used have 4.

Show All Leader Keys

NEVER Need to Press Meta

Any emacs command that has a Meta (Alt) keybinding also have a keybinding without Meta in Xah Fly Keys.

For example:

Standard Control Key Shortcuts

The following standard keys are supported by default. (they can be disabled.)

It is not necessary to use these key shortcuts. These commands all have keys that do not need Ctrl.

The only time you need to press Ctrl key are: