Configuring Evil - disable arrow keys and movement line by line?

Frank Fischer frank.fischer at mathematik.tu-chemnitz.de
Mon Nov 21 08:58:56 CET 2011


On Sun, Nov 20, 2011 at 01:08:29PM -0900, Chris Lott wrote:
> In my normal .gvimrc I have disabled arrow keys using the following
> (grabbed from the web somewhere):
> 
> "disable arrow keys so I am forced to use the 'real' movement keys
> inoremap  <Up>     <NOP>
> inoremap  <Down>   <NOP>
> inoremap  <Left>   <NOP>
> inoremap  <Right>  <NOP>
> noremap   <Up>     <NOP>
> noremap   <Down>   <NOP>
> noremap   <Left>   <NOP>
> noremap   <Right>  <NOP>

(define-key evil-insert-state-map [left] 'undefined)
(define-key evil-insert-state-map [right] 'undefined)
(define-key evil-insert-state-map [up] 'undefined)
(define-key evil-insert-state-map [down] 'undefined)

(define-key evil-motion-state-map [left] 'undefined)
(define-key evil-motion-state-map [right] 'undefined)
(define-key evil-motion-state-map [up] 'undefined)
(define-key evil-motion-state-map [down] 'undefined)

Motion state map disables the cursor keys in normal, operator, visual
as well as the special motion states.

> And I have mapped keys so that movement is visual line by line (since
> I usually work in a wrapping mode where each paragraph is a line):
> 
> nnoremap j gj
> nnoremap k gk
> vnoremap j gj
> vnoremap k gk

(define-key evil-motion-state-map "j" #'evil-next-visual-line)
(define-key evil-motion-state-map "k" #'evil-previous-visual-line)

Frank



More information about the implementations-list mailing list