Skip to content

Binding SPC SPC to a command #482

Answered by okamsn
zetashift asked this question in Q&A
Jul 19, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

I have not been able to get this working because of bad elisp, how exactly is my-leader-map defined?

It is just a normal keymap :

;; Bind variable to a non-sparse (as in not from `make-sparse-keymap') empty keymap:
(defvar my-leader-map (make-keymap) "My leader map.")

;; Make Meow use the leader key:
(setf meow-keypad-leader-dispatch my-leader-map
      (map-elt meow-keymap-alist 'leader) my-leader-map)

;; Bind key sequence to a command in the keymap contained by the variable:
(define-key my-leader-map (kbd "<SPC>") #'execute-extended-command)

If I recall correctly, I originally used make-sparse-keymap, but that didn't work for some reason.

In newer Emacs, it looks like you can do

(d…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@zetashift
Comment options

Comment options

You must be logged in to vote
1 reply
@zetashift
Comment options

Comment options

You must be logged in to vote
1 reply
@zetashift
Comment options

Answer selected by zetashift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants