Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map j and k to gj and gk in Emacs Evil-mode?

I would like to map j k motions in evil to be gj and gk respectively. This is a common remapping people usually do in vim. How can I do that in Emacs. I guess I just need to find how these Evil functions that correspond to gj and gk motions are named.

like image 288
egdmitry Avatar asked May 10 '14 01:05

egdmitry


1 Answers

The functions you're looking for are evil-next-visual-line and evil-previous-visual-line. You can bind them with:

(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
like image 139
tungd Avatar answered Oct 02 '22 06:10

tungd