0

The bindings of C-j C-k to evil-window-down[up] work well every where apart form term mode. term mode rebinds these to C-w j C-w k - this is super annoying! How can i make term use the C-j/C-k bindings I use every where else?

At the moment i'm doing this:

(define-key evil-motion-state-map (kbd "C-h") 'evil-window-left)
(define-key evil-motion-state-map (kbd "C-j") 'evil-window-down)
(define-key evil-motion-state-map (kbd "C-k") 'evil-window-up)
(define-key evil-motion-state-map (kbd "C-l") 'evil-window-right)

(define-key evil-normal-state-map (kbd "C-h") 'evil-window-left)
(define-key evil-normal-state-map (kbd "C-j") 'evil-window-down)
(define-key evil-normal-state-map (kbd "C-k") 'evil-window-up)
(define-key evil-normal-state-map (kbd "C-l") 'evil-window-right)

(define-key global-map (kbd "C-h") #'evil-window-left)
(define-key global-map (kbd "C-j") #'evil-window-down)
(define-key global-map (kbd "C-k") #'evil-window-up)
(define-key global-map (kbd "C-l") #'evil-window-right)

But term and Python Inferior REPL processes override them.

2
  • 1
    What have you tried so far?
    – Dan
    Apr 22, 2021 at 11:43
  • i updated the question with what i tried so far
    – chris
    Apr 23, 2021 at 8:03

1 Answer 1

1

I have the same problem when I am using org mode.
The following code solves it.
Note that you need the following package:
noctuid/general.el: More convenient key definitions in emacs

  (general-override-mode)

  (general-def 'normal 'override
    "C-h" 'evil-window-left
    "C-j" 'evil-window-down
    "C-k" 'evil-window-up
    "C-l" 'evil-window-right
    )

Reference: https://github.com/noctuid/evil-guide#user-content-preventing-certain-keys-from-being-overridden

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.