In my emacs, tide-mode
has a key for jump-to-definition
of g d
I would like to define keys like this where i do not need a prefix (I use evil, so it would be in normal mode).
When I try this:
(global-set-key (kbd "g c c") 'comment-or-uncomment-region)
I get the message: Key sequence g c c starts with a non-prefix key
Is this possible?
g
org c
is not a prefix key. Seedefine-prefix-command
. See also https://emacs.stackexchange.com/a/13418 and https://emacs.stackexchange.com/q/58264. – Drew Mar 05 '23 at 17:10(define-key evil-motion-state-map (kbd "gcc") 'comment-or-uncomment-region)
. – Oliver Knodel Mar 05 '23 at 19:24g
is already bound to a command in the global map, therefore (as the error tells you) it cannot also be a prefix. – phils Mar 05 '23 at 21:50evil
key bindings, you should useevil
keymaps. – phils Mar 05 '23 at 21:57