Skip to content

Commit

Permalink
kbd-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
papercatlol committed Aug 12, 2021
1 parent 5cec13f commit fa498b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions init.el
Expand Up @@ -1056,6 +1056,16 @@ current entry."
(ansi-color-apply-on-region (point-min) (point-max))))
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)

;;* kbd-helper
(defun kbd-helper ()
"Read a key sequence and return it in a format suitable for `kbd'.
If called interactively, quote and insert it."
(interactive)
(let ((key (key-description (read-key-sequence "Key Sequence: "))))
(if (interactive-p)
(insert (format "\"%s\"" key))
key)))

;;* keybindings
(global-unset-key (kbd "C-z"))
(global-set-key (kbd "M-/") 'hippie-expand)
Expand Down

0 comments on commit fa498b0

Please sign in to comment.