0

I have read multiple posts on this site to try and solve this issue.

I am trying to define an evil key to nil. Like this:

(with-eval-after-load 'evil-maps
  (define-key evil-motion-state-map (kbd "S-k") nil))

or

(with-eval-after-load 'evil-maps
  (define-key evil-normal-state-map (kbd "S-k") nil))

My goal is to reassing S-k to windmove-up. However, when I press C-h k and then S-k, it says that S-k is bound to evil-lookup found in the evil-motion-state-map.

But even after a reset this key no not unbound.

What am I doing wrong?

4
  • I don't know why your 'define-key's don't work. But have you tried evil-global-set-key? Nov 6, 2022 at 8:39
  • Would I be testing that inside the (define-key...) part?
    – Vinn
    Nov 6, 2022 at 8:49
  • No, see evil.readthedocs.io/en/latest/… Nov 6, 2022 at 9:28
  • 1
    The first comment was just a (quick) suggestion but you did not provide feedback about the results. Anyway, I have added a correct answer now. Nov 11, 2022 at 15:29

1 Answer 1

1

You should use capital K instead of S-k as follows

(define-key evil-motion-state-map "K" nil)

or nicer (I think)

(evil-global-set-key 'motion "K" nil)

If you place it after activating (evil-mode) then there is no need to use with-eval-after-load.

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.