0

I am observing a strange behavior in evil-mode that I'm unable to figure out what is causing it: In insert-state, pressing "M" does not insert a capital m as expected, but instead gives me the following prompt in the minibuffer (see screenshot 1 below). Strangely, "M" works in visual-state and normal-mode. I have double checked my init.el and I have not accidentally bound M to anything, and all other letters seem to work.

What kind of mode is this showing and how can I debug this?

Update: I tried C-h k M in insert-state, but this just gave me this: screenshot 2

Update: Turns out this line was the culprit:

(define-key evil-insert-state-map "M-r" 'evil-paste-from-register)

Is this a bug in evil-mode?

screenshot 1

3
  • try C-h k M in insert mode
    – nichijou
    Commented Feb 17, 2023 at 0:13
  • @nichijou: I did, and updated the question with the result.
    – NewToEmacs
    Commented Feb 17, 2023 at 1:11
  • What does C-h k tell you for M?
    – Drew
    Commented Feb 17, 2023 at 2:15

1 Answer 1

1

In answer to your 'update',

You should use an escape character before the "M" as explained in the Changing Key Bindings section of the elisp manual.

Alternatively, you could wrap the "M-r" in a kbd form as explained in the Key Sequences section of the elisp manual.

(evil-paste-from-register is bound to C-r by default in evil insert state, but I guess you are aware of that already. Just to be sure...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.