I love intuitive keymaps. Some are so perfect, you just can’t avoid
mouthing the words every time you hit that blissful combo. A wizard
murmuring an incantation under his breath as his fingers draw the
arcane patterns.
The following keymap toggles some options which tend to be useful
throughout a session.
(define-prefix-command'endless/toggle-map);; The manual recommends C-c for user keys, but C-x t is;; always free, whereas C-c t is used by some modes.(define-keyctl-x-map"t"'endless/toggle-map)(define-keyendless/toggle-map"c"#'column-number-mode)(define-keyendless/toggle-map"d"#'toggle-debug-on-error)(define-keyendless/toggle-map"e"#'toggle-debug-on-error)(define-keyendless/toggle-map"f"#'auto-fill-mode)(define-keyendless/toggle-map"l"#'toggle-truncate-lines)(define-keyendless/toggle-map"q"#'toggle-debug-on-quit)(define-keyendless/toggle-map"t"#'endless/toggle-theme);;; Generalized version of `read-only-mode'.(define-keyendless/toggle-map"r"#'dired-toggle-read-only)(autoload'dired-toggle-read-only"dired"nilt)(define-keyendless/toggle-map"w"#'whitespace-mode)
There are eight keys being defined there, most of which aren’t even
used every day, but I know I’ll never forget a single one. That is the
beauty of mnemonics.
Doesn’t “Emacs, toggle column” just roll off your tongue as you’re
typing C-x t c? I feel like I’m commanding the
strands of reality, but that could just be my D&D past taking the
better of me.
Also note: The manual recommends C-c for user keys, but I like using C-x for global keys and using C-c for mode-specific keys.
The Toggle-Map and Wizardry
19 Jul 2014, by Artur Malabarba.Mnemonic Keymaps post series
I love intuitive keymaps. Some are so perfect, you just can’t avoid mouthing the words every time you hit that blissful combo. A wizard murmuring an incantation under his breath as his fingers draw the arcane patterns.
The following keymap toggles some options which tend to be useful throughout a session.
There are eight keys being defined there, most of which aren’t even used every day, but I know I’ll never forget a single one. That is the beauty of mnemonics.
Doesn’t “Emacs, toggle column” just roll off your tongue as you’re typing C-x t c? I feel like I’m commanding the strands of reality, but that could just be my D&D past taking the better of me.
Also note: The manual recommends C-c for user keys, but I like using C-x for global keys and using C-c for mode-specific keys.
Tags: keymap, intuitive, keybind, init.el, emacs,
Manually Choose a Fallback Font for Unicode »
« Inserting Documentation Quotes
Related Posts
A few paredit keys that take over the world in keybind
Fill and unfill paragraphs with a single key in keybind
Disable Mouse only inside Emacs in keybind
Content © 2019, All rights reserved. Icons under CC3.0.