Skip to content

Instantly share code, notes, and snippets.

@cataska
Last active April 21, 2022 10:02
Show Gist options
  • Save cataska/b1875754128853bfb139 to your computer and use it in GitHub Desktop.
Save cataska/b1875754128853bfb139 to your computer and use it in GitHub Desktop.
Emacs key binding alias
(defmacro defkbalias (old new)
`(define-key (current-global-map) ,new
(lookup-key (current-global-map) ,old)))
;; now "C-x -" equals to "C-x 2"
(defkbalias (kbd "C-x 2") (kbd "C-x -"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment