From 5af6430538a5817aeb3532300933f9ae771f76f7 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Wed, 22 Sep 2021 15:57:21 -0400 Subject: [PATCH] Cleanup the tarmak stages thingie --- global.org | 115 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 42 deletions(-) diff --git a/global.org b/global.org index 2615ad1..3573fc7 100644 --- a/global.org +++ b/global.org @@ -2223,48 +2223,79 @@ #+end_src * Moving to colemak -#+begin_src emacs-lisp - (defun set-key-translation-map (pairs) - (dolist (p pairs) - (define-key key-translation-map (kbd (downcase (car p))) (kbd (downcase (cdr p)))) - (define-key key-translation-map (kbd (upcase (car p))) (kbd (upcase (cdr p)))))) - - (defun set-key-translation-map-caseless (pairs) - (dolist (p pairs) - (define-key key-translation-map (kbd (car p)) (kbd (cdr p))) - )) - - (defun reset-key-translation-map () - (dolist (c '("j" "k" "n" "e")) - (define-key key-translation-map (kbd (downcase c)) nil) - (define-key key-translation-map (kbd (upcase c)) nil))) - - - (defun tarmak1 () - (interactive) - (set-key-translation-map '(("j" . "n") - ("k" . "e") - ("n" . "k") - ("e" . "j")))) - - - (defun untarmak-modifiers () - (interactive) - (set-key-translation-map-caseless - (mapcan (lambda (swap-pair) - (mapcar (lambda (mod-combo) - (cons (concat mod-combo - (car swap-pair)) - (concat mod-combo - (cdr swap-pair)))) - modifier-combo)) - tarmak1-swaps))) - - (defun qwerty() - (interactive) - - (reset-key-translation-map)) -#+end_src +Set up all possible combinations of modifiers + #+begin_src emacs-lisp + (defun concat-recursive (b &optional a) + (if b + (append (concat-recursive (cdr b) (concat a (car b))) + (concat-recursive (cdr b) a)) + (when a (list a)))) + + (setq modifier-combo (concat-recursive '("C-" "M-" "s-" "H-"))) + #+end_src + Then list the swapped keys + #+begin_src emacs-lisp + (setq tarmak1-swap-alist '(("j" . "e") + ("e" . "k") + ("k" . "n") + ("n" . "j"))) + (setq tarmak2-swap-alist '(("j" . "g") + ("g" . "t") + ("t" . "f") + ("f" . "e") + ("e" . "k") + ("k" . "n") + ("n" . "j"))) + #+end_src + + #+begin_src emacs-lisp + (defun set-key-translation-map (pairs) + (dolist (p pairs) + (define-key key-translation-map (kbd (downcase (car p))) (kbd (downcase (cdr p)))) + (define-key key-translation-map (kbd (upcase (car p))) (kbd (upcase (cdr p)))))) + + (defun set-key-translation-map-caseless (pairs) + (dolist (p pairs) + (define-key key-translation-map (kbd (car p)) (kbd (cdr p))))) + + (defun reset-key-translation-map () + (dolist (c '("j" "k" "n" "e" "f" "t" "g")) + (define-key key-translation-map (kbd (downcase c)) nil) + (define-key key-translation-map (kbd (upcase c)) nil))) + + + (defun tarmak1 () + (interactive) + (set-key-translation-map '(("j" . "n") + ("k" . "e") + ("n" . "k") + ("e" . "j")))) + + + (defun untarmak-modifiers () + (interactive) + (set-key-translation-map-caseless + (mapcan (lambda (swap-pair) + (mapcar (lambda (mod-combo) + (cons (concat mod-combo + (car swap-pair)) + (concat mod-combo + (cdr swap-pair)))) + modifier-combo)) + tarmak2-swap-alist))) + + (defun tarmak-avy () + (interactive) + (setq aw-keys '(?n ?t ?h ?j ?e ?d ?l ?s ?a) + avy-keys '(?a ?s ?d ?t ?j ?h ?n ?e ?l))) + + + (defun qwerty() + (interactive) + + (reset-key-translation-map)) + + #+end_src * Finale ** Fixup faces This is really a workaround as I do not like either bold or italic.