Emacs: Xah Fly Keys πŸ“¦

By Xah Lee. Date: . Last updated: .

What is Xah Fly Keys

xah-fly-keys.el is a modal editing mode for emacs, like vi, but the design of key and command choice is based on command frequency statistics and ease-of-key score of key position and finger ergonomics. 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 is more efficient than vim.

Updates News

Video Intro to Xah Fly Keys

[画像:vidthumb deg74diF 2Q]

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
;; qgmlwb
;; qwerty
;; qwerty-abnt (Brazil)
;; qwerty-no (Norwegian)
;; qwerty-se (Swedish)
;; qwertz
;; qwpr
;; russian
;; workman

(xah-fly-keys 1)

What Does Command Mode Do?

When in command mode:

  • Right hand letter keys are moving cursor, in general. For example, i j k l , are arrows.
  • Left hand letter keys are deleting/modifying text.
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 , . ' \ / = - unsplit [ split - ] split | ; ` Xah Fly Keys command mode layout M-x ↩ ()⌫ insert mark ↓ β†’ ← ΒΆ|← β†’|ΒΆ ⌦w format ␣⌫ w⌫ cancel undo β†’w ↑ w← ␣ Case search paste cut copy cmt (← β†’) (↔) next w leader key

Activate Command Mode

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

By default, it has the following keys:

  • Esc
  • Alt+Space
  • Ctrl+Space

Visual Indicator for Command Mode

When in command mode, current line is highlighted. (via hl-line-mode)

[画像:Xah Fly Keys command mode 2025εΉ΄07月20ζ—₯ 337e3]
Xah Fly Keys command mode 2025εΉ΄07月20ζ—₯ 337e3

How to Find Out What a Key Do in Command Mode

  1. Activate command mode (press Esc)
  2. 【Space j v】 (describe-key)
  3. press the key.

Insert Mode

When in insert mode, keys insert characters. It is essentially like Xah Fly Keys is off.

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.

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.

Space Space
xah-fly-insert-mode-activate
Space Enter
execute-extended-command
Space f
switch-to-buffer
Space h
beginning-of-buffer
Space n
end-of-buffer
Space r
query-replace
Space k r
query-replace-regexp
Space i e
open file (find-file)
Space i d
list buffers (ibuffer)

There are about 270 commands with leader key sequence.

Which Key Mode

By default, when you press Space, available subsequent keys and their commands are displayed. (via Which Key Mode, new in Emacs 30 (date 2025) )

[画像:Xah Fly Keys which key mode 2025εΉ΄07月20ζ—₯]
Xah Fly Keys which key mode 2025εΉ΄07月20ζ—₯

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:

  • Alt+f (forward-word) is o while in command mode.
  • Alt+% (query-replace) is Space r while in command mode.

Standard Control Key Shortcuts

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

  • Ctrl+Tab β†’ next user buffer
  • Ctrl+Shift+Tab β†’ previous user buffer
  • Ctrl+v β†’ paste
  • Ctrl+w β†’ close buffer
  • Ctrl+z β†’ undo
  • Ctrl+n β†’ new buffer
  • Ctrl+o β†’ open
  • Ctrl+s β†’ save
  • Ctrl+Shift+s β†’ save as
  • Ctrl+Shift+t β†’ open last closed
  • Ctrl+= β†’ larger font
  • Ctrl+- β†’ smaller font

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:

  • Ctrl+c β†’ for major mode commands.
  • Ctrl+g β†’ for canceling command or key.
  • Ctrl+q β†’ for quoted-insert.
  • Ctrl+h β†’ for help.

Major Contributors

2020εΉ΄04月18ζ—₯ Major key engine rewrite by Dan Langlois (https://github.com/DanLanglois) and Will Dey (https://github.com/wi11dey). It prevents Xah Fly Keys from being overriden by other major or minor modes. It does this using set-transient-map.

[画像:xah fly keys kinesis 2017 09 60363]
Xah Fly Keys and Kinesis keyboard, from a friend

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /