{"id":17606323,"url":"https://github.com/gcentauri/xah-fly-keys-layer","last_synced_at":"2026-01-31T18:32:48.788Z","repository":{"id":98230065,"uuid":"160060854","full_name":"gcentauri/xah-fly-keys-layer","owner":"gcentauri","description":"Spacemacs configuration layer for the xah-fly-keys package","archived":false,"fork":false,"pushed_at":"2019-11-24T15:32:54.000Z","size":70,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-18T08:50:21.316Z","etag":null,"topics":["ergonomics","keymap","productivity","spacemacs","spacemacs-layer"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gcentauri.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-02T15:23:43.000Z","updated_at":"2025-02-26T13:10:44.000Z","dependencies_parsed_at":"2023-05-18T19:00:13.355Z","dependency_job_id":null,"html_url":"https://github.com/gcentauri/xah-fly-keys-layer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gcentauri/xah-fly-keys-layer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcentauri%2Fxah-fly-keys-layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcentauri%2Fxah-fly-keys-layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcentauri%2Fxah-fly-keys-layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcentauri%2Fxah-fly-keys-layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcentauri","download_url":"https://codeload.github.com/gcentauri/xah-fly-keys-layer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcentauri%2Fxah-fly-keys-layer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28949414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ergonomics","keymap","productivity","spacemacs","spacemacs-layer"],"created_at":"2024-10-22T15:44:14.857Z","updated_at":"2026-01-31T18:32:48.767Z","avatar_url":"https://github.com/gcentauri.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: xah-fly-keys layer\n\n[[file:img/xah-logo.png]]\n\n* Table of Contents                                        :TOC_4_gh:noexport:\n- [[#description][Description]]\n  - [[#features][Features:]]\n- [[#install][Install]]\n  - [[#configuration][Configuration]]\n    - [[#keyboard-layout][Keyboard layout]]\n    - [[#cursor-appearance-for-command-and-insert-modes][Cursor appearance for command and insert modes]]\n    - [[#preferred-incremental-search-function][Preferred incremental search function]]\n    - [[#preferred-m-x-function][Preferred M-x function]]\n  - [[#swap-the-leader-keys][Swap the leader keys]]\n- [[#key-bindings][Key bindings]]\n  - [[#command-mode][Command mode]]\n  - [[#leader-key-map][Leader Key Map]]\n  - [[#sub-keymaps][Sub keymaps]]\n\n* Description\nThis layer adds an alternative modal editing mode for Emacs.\n\n#+BEGIN_QUOTE\n\"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.\"\n#+END_QUOTE\n\n[[http://ergoemacs.org/misc/ergoemacs_vi_mode.html][xah-fly-keys]] has been developed over years of experience by Xah Lee, a long time contributer to the Emacs community.\n\nGain the modal superpowers of the dark side, without succumbing to evil!\n\n** Features:\n\n- You NEVER need to press 【Ctrl+x】or Meta! Use a leader key instead!\n- There are about 200 commands with leader key sequences.\n- Efficient keys for common navigation and editing tasks in command mode.\n- The key bindings are based on experience and [[http://ergoemacs.org/emacs/command-frequency.html][observed frequency of use]].\n\n* Install\nClone this repository into =.emacs.d/private/xah-fly-keys=, or where ever you\nkeep your private layers:\n\n#+begin_src sh\ngit clone https://github.com/gcentauri/xah-fly-keys-layer.git ~/.emacs.d/private/xah-fly-keys\n#+end_src\n\nNote - the directory the layer files are in must be named =xah-fly-keys=.\n\nTo use this configuration layer, add it to your =~/.spacemacs=. You will need to\nadd =xah-fly-keys= to the existing =dotspacemacs-configuration-layers= list in\nthis file. You should have the =dotspacemacs-editing-style= set to ='emacs=.\n\nIt is recommended to change some of the defaults in your =.spacemacs= file, in\norder to avoid some unwanted cross-over with some key bindings.\n\n  - set the =dotspacemacs-leader-key= to an empty string, as having it set to\n    =SPC= interferes with the =which-key= mappings.\n  - set =dotspacemacs-colorize-cursor-according-to-state nil= so that the cursor\n    will reflect the =xah-fly-keys= state instead.\n\n** Configuration\n*** Keyboard layout\nThis layer assumes a =qwerty= layout and uses that by default. You can configure\nxah-fly-keys to use other keyboard layouts with the =xah-fly-keys-layout=\nvariable.\n\nThe possible values are:\n- =azerty=, =azerty-be=\n- =colemak=, =colemak-mod-dh=\n- =dvorak=, =programer-dvorak=\n- =qwerty=, =qwerty-abnt=\n- =qwertz=\n- =workman=\n\nFor example, to use the =dvorak= layout, add the following to your layers list:\n\n#+BEGIN_SRC elisp\n(xah-fly-keys :variables xah-fly-keys-layout \"dvorak\")\n#+END_SRC\n\n*** Cursor appearance for command and insert modes\nYou can customize the appearance of the cursor using two variables:\n  - =xah-fly-keys-command-mode-cursor=\n  - =xah-fly-keys-insert-mode-cursor=\n\nBoth variables are a pair of the form =(COLOR . CURSOR-TYPE)=. =COLOR= is a string,\neither one of the defined color words in the =list-colors-display= or a hex\ncode for the color. The =CURSOR-TYPE= is one of the types that can be set on\nthe =cursor-type= variable:\n\n#+begin_example\n  t               use the cursor specified for the frame\n  nil             don’t display a cursor\n  box             display a filled box cursor\n  hollow          display a hollow box cursor\n  bar             display a vertical bar cursor with default width\n  (bar . WIDTH)   display a vertical bar cursor with width WIDTH\n  hbar            display a horizontal bar cursor with default height\n  (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT\n  ANYTHING ELSE   display a hollow box cursor\n#+end_example\n\nFor example,\n\n#+begin_src elisp\n  (xah-fly-keys :variables\n                xah-fly-keys-command-mode-cursor '(\"yellow\" . box)\n                xah-fly-keys-insert-mode-cursor '(\"#ff00ff\" . hbar))\n#+end_src\n\nIt defaults to very distinctive, contrasting cursors to help indicate state. :smile:\n\n*** Preferred incremental search function\nThis will default to either =helm-swoop= or =swiper= if helm/ivy layer is used.\nOtherwise it will be =isearch-foward=. You can set it to your preferred command.\n\n#+BEGIN_SRC elisp\n(xah-fly-keys :variables xah-fly-keys-search-function 'helm-swoop)\n#+END_SRC\n\n*** Preferred M-x function\nThis defaults to the standard =execute-extended-command=, which seems to be\nremapped by helm or ivy if those layers are installed. Set this variable if\nyou prefer another =M-x= command or need to configure it explicitly.\n\n#+BEGIN_SRC elisp\n(xah-fly-keys :variables xah-fly-keys-M-x-function 'counsel-M-x)\n#+END_SRC\n\n** Swap the leader keys\nIf you'd like to have the Spacemacs leader key on the space bar rather than the xah-fly-keys\nmenu, then it's possible to swap them.\n\nI tried implementing this with a config variable, but it doesn't quite work as expected.\nUntil that is sorted out, add this to your =dotspacemacs/user-config= to swap the leader\nkeys for Spacemacs and xah-fly-keys.\n\n#+BEGIN_SRC elisp\n(defun xah-fly-keys-swap-spacemacs-leader ()\n      (progn\n        (define-key xah-fly-key-map (kbd \"SPC\") 'spacemacs-cmds)\n        (define-key xah-fly-key-map (kbd \"M-m\") 'xah-fly-leader-key-map)))\n\n(add-hook 'xah-fly-command-mode-activate-hook 'xah-fly-keys-swap-spacemacs-leader)\n#+END_SRC\n\nYou'll also need to set the =dotspacemacs-emacs-leader= key to an empty string.\nIt appears that sometimes the =which-key= menu will be affected by this change.\n\n* Key bindings\n\nSee [[http://ergoemacs.org/misc/ergoemacs_vi_mode.html][xah-fly-keys]] for the modal keymap defined by Xah Lee.\n\n** Command mode\n\n| Key binding | Description                              |\n|-------------+------------------------------------------|\n| ~M-m~       | spacemacs commands keymap                |\n| ~ESC~       | xah-fly-leader-key-map                   |\n| ~SPC~       | xah-fly-leader-key-map                   |\n| ~'~         | xah-cycle-hyphen-underscore-space        |\n| ~,~         | xah-next-window-or-frame                 |\n| ~-~         | xah-backward-punct                       |\n| ~.~         | xah-forward-right-bracket                |\n| ~/~         | xah-goto-matching-bracket                |\n| ~0~         | xah-pop-local-mark-ring                  |\n| ~1~         | xah-extend-selection                     |\n| ~2~         | xah-select-line                          |\n| ~3~         | delete-other-windows                     |\n| ~4~         | split-window-below                       |\n| ~5~         | delete-char                              |\n| ~6~         | xah-select-block                         |\n| ~7~         | xah-select-line                          |\n| ~8~         | xah-extend-selection                     |\n| ~9~         | xah-select-text-in-quote                 |\n| ~;~         | xah-end-of-line-or-block                 |\n| ~=~         | xah-forward-punct                        |\n| ~[~         | hippie-expand                            |\n| ~`~         | other-frame                              |\n| ~a~         | smex                                     |\n| ~b~         | xah-toggle-letter-case                   |\n| ~c~         | xah-copy-line-or-region                  |\n| ~d~         | xah-delete-backward-char-or-bracket-text |\n| ~e~         | backward-kill-word                       |\n| ~f~         | xah-fly-insert-mode-activate             |\n| ~g~         | xah-delete-current-text-block            |\n| ~h~         | xah-beginning-of-line-or-block           |\n| ~i~         | previous-line                            |\n| ~j~         | backward-char                            |\n| ~k~         | next-line                                |\n| ~l~         | forward-char                             |\n| ~m~         | xah-backward-left-bracket                |\n| ~n~         | isearch-forward                          |\n| ~o~         | forward-word                             |\n| ~p~         | xah-insert--space-before                 |\n| ~q~         | xah-reformat-lines                       |\n| ~r~         | xah-kill-word                            |\n| ~s~         | open-line                                |\n| ~t~         | set-mark-command                         |\n| ~u~         | backward-word                            |\n| ~v~         | xah-paste-or-paste-previous              |\n| ~w~         | xah-shrink-whitespaces                   |\n| ~x~         | xah-cut-line-or-region                   |\n| ~y~         | undo                                     |\n| ~z~         | xah-comment-dwim                         |\n| ~DEL~       | xah-fly-leader-key-map                   |\n| ~\u003cC-f11\u003e~   | xah-previous-emacs-buffer                |\n| ~\u003cC-f12\u003e~   | xah-next-emacs-buffer                    |\n| ~\u003cf11\u003e~     | xah-~previous-user-buffer                |\n| ~\u003cf12\u003e~     | xah-next-user-buffer                     |\n| ~\u003cf8\u003e~      | xah-fly-command-mode-activate-no-hook    |\n| ~\u003cf9\u003e~      | xah-fly-leader-key-map                   |\n| ~\u003chome\u003e~    | xah-fly-command-mode-activate            |\n| ~\u003cmenu\u003e~    | xah-fly-command-mode-activate            |\n\n** Leader Key Map\n\n| Key Binding | Description                     |\n|-------------+---------------------------------|\n| ~SPC TAB~   | xah-fly--tab-key-map            |\n| ~SPC RET~   | execute-extended-command        |\n| ~SPC SPC~   | xah-fly-insert-mode-activate    |\n| ~SPC '~     | xah-show-form-feed-as-line      |\n| ~SPC ,~     | xah-fly-w-keymap                |\n| ~SPC 3~     | delete-window                   |\n| ~SPC 4~     | split-window-right              |\n| ~SPC 5~     | balance-windows                 |\n| ~SPC 6~     | xah-upcase-sentence             |\n| ~SPC 9~     | ispell-word                     |\n| ~SPC ;~     | save-buffer                     |\n| ~SPC \\~     | toggle-input-method             |\n| ~SPC a~     | mark-whole-buffer               |\n| ~SPC b~     | xah-toggle-previous-letter-case |\n| ~SPC c~     | xah-copy-all-or-region          |\n| ~SPC d~     | xah-fly-e-keymap                |\n| ~SPC e~     | xah-fly-dot-keymap              |\n| ~SPC f~     | switch-to-buffer                |\n| ~SPC g~     | kill-line                       |\n| ~SPC h~     | beginning-of-buffer             |\n| ~SPC i~     | xah-fly-c-keymap                |\n| ~SPC j~     | xah-fly-h-keymap                |\n| ~SPC k~     | xah-fly-t-keymap                |\n| ~SPC l~     | xah-fly-n-keymap                |\n| ~SPC m~     | dired-jump                      |\n| ~SPC n~     | end-of-buffer                   |\n| ~SPC o~     | xah-fly-r-keymap                |\n| ~SPC p~     | recenter-top-bottom             |\n| ~SPC q~     | xah-fill-or-unfill              |\n| ~SPC r~     | query-replace                   |\n| ~SPC s~     | exchange-point-and-mark         |\n| ~SPC t~     | xah-show-kill-ring              |\n| ~SPC u~     | isearch-forward                 |\n| ~SPC v~     | xah-paste-or-paste-previous     |\n| ~SPC w~     | xah-fly-comma-keymap            |\n| ~SPC x~     | xah-cut-all-or-region           |\n| ~SPC y~     | xah-search-current-word         |\n| ~SPC DEL~   | xah-fly-insert-mode-activate    |\n\n** Sub keymaps\n\nYou'll notice that there are several sub keymaps after pressing a leader key.\nThese are organized by ease of use, and should really be categorized by\nfinger and keyboard row. I've listed some of the functionality for each of the\nkeymaps, but use =which-key= and you'll discover more details.\n\n- 【SPC ,】 - Eval, kill emacs\n- 【SPC k】 - registers, replace, occur\n- 【SPC o】 - rectangles, macros, number registers\n- 【SPC l】 - modes, view, windows\n- 【SPC j】 - help, apropos, info\n- 【SPC d】 - inserting chars, brackets, unicode\n- 【SPC i】 - files, bookmarks, external apps\n- 【SPC w】 - xref, find identifiers\n- 【SPC e】 - search, highlight, fonts\n- 【SPC TAB】 - indent, expand, abbrev\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcentauri%2Fxah-fly-keys-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcentauri%2Fxah-fly-keys-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcentauri%2Fxah-fly-keys-layer/lists"}