Xah Fly Keys and my Emacs config

Last modified:


Xah Lee has interested me since I discovered him. His remarkable productivity should make him a valuable resource for anyone interested in keyboards, Emacs, and related topics. I highly recommend his fantastic site. I use Xah Fly Keys, an Emacs package by Xah Lee, which enhances Emacs keybindings for greater efficiency.


Emacs is more than just an editor. It can be customized to suit your preferences. Emacs is powerful, but its learning curve is steep. The default keybindings aren't great, but can be modified.

Emacs can be used as file manager too. This is mainly why I wanted to learn it. The file manager has bookmarks, and you can rename many files quickly. Org-mode is good for taking notes, and you can build your website with it.

Ergonomics made simple

To prevent keyboard injuries, balance computer use with outdoor breaks and invest in a mechanical keyboard. Many enthusiasts overcomplicate matters, and spread misinformation. Yet, proper typing and mouse-handling techniques are crucial. Hovering your hands and not resting your palms is a key principle. Xah Lee has many guides on how to use your keyboard and mouse. Touch typing is highly recommended if you type a lot. Most programmers do not type as much as they think.

My recommendation is to pick up other hobbies besides using the computer. Live a little. Using Linux can be easy depending on your needs, but usually people make it hard. They waste much time on fine-tuning it. The same issue exists on Windows, but people tend to do it less. They do it during the initial install only. It has benefits if you know what you are doing. Although many people do more wrong than right with it.

Emacs configuration

;; Important xah fly emacs distro
;; Buy it here: http://xahlee.info/emacs/misc/xahemacs.html
(load-file "~/.emacs.d/xahemacs/xahemacs_init.el")

;; No beep
(setq visible-bell 1)

;; xahemacs personal tweaks
(xah-fly-keys-set-layout "dvorak")
   xah-fly-use-control-key nil
   xah-fly-use-meta-key nil
   ;; disable shift select
   shift-select-mode nil)

;; Font-size 8pt
(set-face-attribute 'default nil :height 80)

;; Hide dired details
(defun hide-details-dired-mode-setup ()
  "to be run as hook for `dired-mode'."
  (dired-hide-details-mode 1))
(add-hook 'dired-mode-hook 'hide-details-dired-mode-setup)

;; Save bookmark on change
(setq bookmark-save-flag 1)

;; Disable auto collapse org-mode
(setq org-startup-folded t)

;; Soft wrap everything
(global-visual-line-mode t)
(setq visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))

;; Always have spellcheck on
(defun turn-spell-checking-on ()
  "Turn speck-mode or flyspell-mode on."
  ;; (speck-mode 1)
  (flyspell-mode 1))
(add-hook 'text-mode-hook 'turn-spell-checking-on)

;; Performance tweaking for modern machines, not needed for my config
(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024))

I bought XahEmacs, and encourage you to do the same after you have watched videos of Xah Lee using Emacs. Xah fly keys may be enough, but he deserves the money.


Setting up Emacs on windows can be a bit tricky. First I would install it through winget. Modern windows versions have winget installed. Open a command prompt and type "winget install emacs".

After that you are not set yet. The home directory for Emacs isn't configured well on Windows. The following PowerShell script can be executed to make a Emacs shortcut and set the home directory variable.

$EmacsVersion = "29.2"

# Create Emacs launcher shortcut on desktop
$Shortcut = $WshShell.CreateShortcut("$env:USERPROFILE\Desktop\GNU Emacs.lnk")
$Shortcut.TargetPath = "$env:ProgramFiles\Emacs\Emacs-$EmacsVersion\bin\runemacs.exe"
$Shortcut.Arguments = " -c -n"  

# Change Emacs home to user folder

Make home key easier to press

I have the following AutoHotKey script in my startup folder. It will remap CapsLock to Home if Emacs is open. It is placed under "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup".

Most programs allow remapping shortcuts within the program itself. Thus, I do not have that many AutoHotKey scripts.

#Requires AutoHotkey v2.0
#SingleInstance Force

; Remap capslock to home if emacs is open
HotIfWinActive "ahk_class Emacs"


Diaspora X Facebook LinkedIn