-
Hi, How can I set multiple arbitrary leader keys? For example, helix uses the key Leader gLeader SPCLeader z |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
My current approach is to use Here's a (transient-define-prefix dispatch-goto-menu () "This isn't documentation"
[["Move"
("e" "bottom" end-of-buffer)
("g" "top" beginning-of-buffer)
("d" "definition (xref)" xref-find-definitions)
("h" "beginning of line" beginning-of-line)
("l" "end of line" end-of-line)
("s" "first non-blank-line" beginning-of-line-text)]
["Buffer"
("n" "next buffer" next-buffer)
("p" "previous buffer" previous-buffer)
("b" "bury buffer" bury-buffer)
("u" "unbury buffer" unbury-buffer)
"Avy"
("c" "goto char" avy-goto-char)
("L" "got line" avy-goto-line)]
["LSP"
("r" "references" lsp-ui-peek-find-references)
"Files"
("f" "file at point" find-file-at-point)
("a" "last file" pop-global-mark)]]) Just bind it like this: (meow-normal-define-key
'("g" . dispatch-goto-menu)) |
Beta Was this translation helpful? Give feedback.
-
I actually do it like this(also a Helix user): (defvar-keymap find-things-keymap
:doc "find some things, cause I forget."
:prefix 'file-things
"b" #'consult-dir
"f" #'consult-fd
"r" #'recentf
"s" #'save-buffer
"t" #'treemacs
"g" #'consult-ripgrep
"p" #'open-emacs-init-file
"y" #'copy-file-path
"w" #'consult-dir) And then use it in meow like this: (meow-leader-define-key
;; SPC j/k will run the original command in MOTION state.
'("j" . "H-j")
'("k" . "H-k")
(cons "f" find-things-keymap)
(cons "c" code-keymap)
...etc |
Beta Was this translation helpful? Give feedback.
-
Thank you for this discussion, it was most helpful to factorize keybindings between meow-leader and plain emacs. I had to go through the transient option because the keymap one requires the keymap to be defined when bound, and it’s not necessarily the case (unless I load everything before meow). |
Beta Was this translation helpful? Give feedback.
My current approach is to use
transient
, and set up key bindings in meow's normal mode to call these different transients.Here's a
transient
somewhat close to Helix'sg
: