Skip to content

Instantly share code, notes, and snippets.

@punitrathore
Created January 17, 2014 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save punitrathore/8468647 to your computer and use it in GitHub Desktop.
Save punitrathore/8468647 to your computer and use it in GitHub Desktop.
elisp to convert a dvorak word to qwerty (requires paredit mode)
(defvar d-q)
(setq d-q (make-hash-table :test 'equal))
(puthash "[" "-" d-q)
(puthash "]" "=" d-q)
(puthash "'" "q" d-q)
(puthash "," "w" d-q)
(puthash "." "e" d-q)
(puthash "p" "r" d-q)
(puthash "y" "t" d-q)
(puthash "f" "y" d-q)
(puthash "g" "u" d-q)
(puthash "c" "i" d-q)
(puthash "r" "o" d-q)
(puthash "l" "p" d-q)
(puthash "/" "[" d-q)
(puthash "=" "]" d-q)
(puthash "\\" "\\" d-q)
(puthash "a" "a" d-q)
(puthash "o" "s" d-q)
(puthash "e" "d" d-q)
(puthash "u" "f" d-q)
(puthash "i" "g" d-q)
(puthash "d" "h" d-q)
(puthash "h" "j" d-q)
(puthash "t" "k" d-q)
(puthash "n" "l" d-q)
(puthash "s" ";" d-q)
(puthash "-" "'" d-q)
(puthash ";" "z" d-q)
(puthash "q" "x" d-q)
(puthash "j" "c" d-q)
(puthash "k" "v" d-q)
(puthash "x" "b" d-q)
(puthash "b" "n" d-q)
(puthash "m" "m" d-q)
(puthash "w" "," d-q)
(puthash "v" "." d-q)
(puthash "z" "/" d-q)
(defun dvorak-to-qwerty ()
(interactive)
(let* ((end (point))
(beg (progn (paredit-backward)
(point)))
(contents (buffer-substring beg end)))
(delete-region beg end)
(dolist (char (append contents nil))
(insert (gethash (concat (list char)) d-q)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment