Skip to content

Instantly share code, notes, and snippets.

@hober
Created October 28, 2012 16:46
Show Gist options
  • Save hober/3969117 to your computer and use it in GitHub Desktop.
Save hober/3969117 to your computer and use it in GitHub Desktop.
Emacs function to fix fantasai's right hand being off-by-one when scribing.
(defun right-hand-querty-correct (b e)
"Fix fantasai's right hand being off by one."
(interactive "r")
(let ((right-hand-keys "
67890-=
yuiop[]\\
hjkl;'
bnm,./"))
(goto-char b)
(while (not (= (point) e))
(let ((p (position (char-after) right-hand-keys)))
(when (and p
(> p 0)
(not (= ?\n
(elt right-hand-keys (1- p)))))
(delete-char 1)
(insert (elt right-hand-keys (1- p)))))
(goto-char (1+ (point))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment