Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meow leader doesn't play nice with prefix-keymaps #627

Open
JordanAnthonyKing opened this issue Aug 15, 2024 · 1 comment
Open

Meow leader doesn't play nice with prefix-keymaps #627

JordanAnthonyKing opened this issue Aug 15, 2024 · 1 comment

Comments

@JordanAnthonyKing
Copy link

With a config like:

(defvar-keymap my-buffer-prefix-keymap
  :doc "buffers"
  "b" #'switch-to-buffer
  "k" #'kill-buffer
  "d" #'kill-buffer
  "p" #'previous-buffer
  "n" #'next-buffer
  "B" #'switch-to-buffer
  "r" #'rename-buffer
  "R" #'revert-buffer)

  (meow-leader-define-key
   '("SPC" . execute-extended-command)
   (cons "b" my-buffer-prefix-keymap))

SPC b b does not switch to insert mode the same way SPC x SPC b (for example only, see later issue) would or similar to how SPC SPC (in my config for execute-extended-command) does.

Secondly, calling SPC x SPC b actually starts my-buffer-prefix-keymap instead of the listed command (switch-buffer).

@DogLooksGood
Copy link
Collaborator

DogLooksGood commented Oct 3, 2024

The leader key definition is only for simple leader keymap. It's a simple translation for commands under mode-specific-map. Usually you can define the keys just as you do it without meow, then use keypad to execute.

In your case, it should be

(defvar-keymap my-buffer-prefix-keymap ...)
(define-key global-map (kbd "C-c b) my-buffer-prefix-keymap)

or even better

(defvar-keymap my-buffer-prefix-keymap ...)
(defalias 'my-buffer-prefix-keymap my-buffer-prefix-keymap) ;; assign the keymap to a symbol
(define-key global-map (kbd "C-c b) 'my-buffer-prefix-keymap) ;; <- we use the symbol here

meow-leader-define-key is not necessary, the vanilla approach is recommended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants