I am new to emacs and I have been trying to remap some of the keys inside of evil mode. I have been trying to remap the keys for switching between windows and so far I have had no luck.
(use-package evil
:config
(evil-mode 1)
(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-motion-state-map (kbd "C-h") 'evil-window-left))
I solved it this way:
(defun evil()
(require 'evil)
(define-key global-map (kbd "C-h") nil)
(define-key global-map (kbd "C-j") nil)
(define-key global-map (kbd "C-k") nil)
(define-key global-map (kbd "C-l") nil)
(global-set-key (kbd "C-h") 'evil-window-left)
(global-set-key (kbd "C-j") 'evil-window-down)
(global-set-key (kbd "C-k") 'evil-window-top)
(global-set-key (kbd "C-l") 'evil-window-right)
(evil-mode 1))
You could also use use-package for this instead of using require