Configuring Evil - disable arrow keys and movement line by line?
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> 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 Can I do the equivalent in Evil somehow? c -- Chris Lott
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
participants (2)
-
Chris Lott -
Frank Fischer