1

I have these keybindings in my dotspacemacs/user-config function:

;; Modify evil-mode keybindings from hjkl motion to jkl;
;; Motion mappings
(define-key evil-motion-state-map "H" 'evil-window-bottom)
(define-key evil-motion-state-map "L" 'evil-window-top)
;;
(define-key evil-motion-state-map "h" 'evil-repeat-find-char)
(define-key evil-motion-state-map "j" 'evil-backward-char)
(define-key evil-motion-state-map "k" 'evil-next-line)
(define-key evil-motion-state-map "l" 'evil-previous-line)
(define-key evil-motion-state-map ";" 'evil-forward-char)
;; Window mappings
(define-key evil-window-map "J" 'evil-window-move-far-left)
(define-key evil-window-map "K" 'evil-window-move-very-bottom)
(define-key evil-window-map "L" 'evil-window-move-very-top)
;;
(define-key evil-window-map "j" 'evil-window-left)
(define-key evil-window-map "k" 'evil-window-down)
(define-key evil-window-map "l" 'evil-window-up)
(define-key evil-window-map ";" 'evil-window-right)

However, when I do SPC w, the evil-window-* bindings aren't what I've defined them as here. They are still mapped to hjkl, instead of jkl; like I'd prefer. The motion mappings work just fine. I'm not really sure what to do here.

1 Answer 1

0

EDIT: Maybe I was a little with the earlier this guesswork, seeing how your movement keybindings are successfully overwritten...

Anyway, what I noticed: the evil-window-map you are binding your keys to is called with C-w rather than SPC w. Your window bindings will show up there.

If you want to alter what is available under SPC w, you should edit the leader key map, for example:

   (spacemacs/set-leader-keys "wj" 'evil-window-left)

Hope this helps. You might need to load these configurations after evil is loaded. To do so, see my original answer below.


Original answer:

I think your keybindings are being overwritten when evil as is loaded after your code is executed.

Try having your configuration executed later by wrapping the relevant lines like so:

 (with-eval-after-load 'evil
  ;; code goes here
  )

Your Answer

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

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