Can't remap Ctrl-j & Ctrl-k

Hi, porting my config from neovim to Emacs.

What happened?

I change the keymaps for “evil-window-(and the direction here)” and these two works pretty nice.

(map! "C-h" #'evil-window-left)
(map! "C-l" #'evil-window-right)

But something happen with this two remaps, just doesn’t work, when i press Ctrl-j i just jump into the last line in the document.

(map! "C-j" #'evil-window-bottom)
(map! "C-k" #'evil-window-top)

What did you expect to happen?

I expect that the focus change to the other window

Steps to reproduce

  1. Add these two lines to the config.el file
(map! "C-j" #'evil-window-bottom)
(map! "C-k" #'evil-window-top)
  1. Try to change the current window focus
  2. It doesn’t work :c

System information

Loading data dump...

Some other major modes with local key bindings may override your global choice.

Can your provide the context where your “C-j” isn’t honored? Which major mode was it?

You can additionally add evil states to the binding, they may override those local bindings (refer to map!'s docs):

(map! :gnvi "C-j" #'evil-window-bottom)

It sounds like the functions you want are actually evil-window-down and evil-window-up?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.