Emacs: Xah Fly Keys Tutorial

By Xah Lee. Date: . Last updated: .

Here's Xah Fly Keys tutorial for beginners. I assume you have made no customization.

Pick a Layout

All keybinding shortcuts on this page changes accordingly.

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, Insert Mode

Exit Emacs

Cursor Movement

move by char

    i
 j k l

move by word

Try them. Try many times. Feel your finger muscles with the cursor movement.

move by paragraph

Repeated call moves by paragraph.

move to begin / end of buffer

Text Editing

undo

To redo, do an undo, then press key to switch to command mode (or Ctrl+g), then do undo. To reverse direction, press Ctrl+g again.

💡 TIP: I recommend not to use any external undo/redo package.

Cut Copy Paste

To paste something twice, call paste, then enter space or return or switch command mode, then paste again.

To paste something 5 times, Space . (universal-argument) 5, then call paste.

Cut All, Copy All

Show Copy History

Copy and Paste to Register

[see Emacs: Copy to Register]

Mark and Text Selection

Text Selection Shortcuts

Call Command by Name (M-x)

Search Text

When in isearch:

There's no key to begin backward search. Just do isearch then press left arrow key.

💡 TIP: i recommend not installing external packages to jump cursor to locations.

Find Replace

New Open Close Save

You can use the following standard keys.

When you are comfortable with Xah Fly Keys, and do not want to use Control key, then use the following.

Open Files

(Emacs: Open Recently Opened File) Open recently opened/closed files:

Emacs: Bookmark related for fast open files:

switch buffer

Split Buffer

3delete-other-windows Unsplit all.

4split-window-below Split top/bottom

,xah-next-window-or-frame Switch cursor to next pane or next window (emacs frame).

Space 3delete-window remove current pane.

Space 4split-window-right split left/right.

💡 TIP: on large monitor, avoid workflow with 1 fullscreen. [see Emacs Workflow: Fullscreen vs Multiple Frames]

Working with Quote and Brackets

xah-fly-keys has a system to work with brackets. Brackets includes ()[]{}“” and all Unicode: Brackets, Quotes «»「」【】《》

Move to Brackets

Select Brackets

when cursor is on a bracket, 8 (xah-extend-selection) selects the whole.

Delete Whole Bracketed Text

dxah-smart-delete when the left char is a bracket, delete the bracketed text. The deleted text is automatically copied.

Delete Bracket Pair

move cursor to the right of a bracket, then Space . (universal-argument) d (xah-smart-delete)

Delete a Single Bracket

move cursor to the left of it, then press 5 (delete-char) .

Insert Brackets

Now, type Space d Ctrl+h to see all other brackets and quotes you can insert.

Change Brackets

Font Size

List All Leader Keys

More Advanced

ok, the above are the basics.

Now, there are about 200 commands with leader keys. These basically replace what emacs C-x does.

You might want to learn them as you go.

When in command mode, press Space Ctrl+h to list all leader key sequence commands.

Remember to use Alt+x describe-function and Alt+x describe-key to find what's the key or command name.