Chiakey
Chiakey

Reputation: 131

How to Alt-hjkl to move cursor stay in insert mode in vim?

In insert mode alt-hjkl will go to normal mode, i dont want.

I want alt-hjkl move the cursor and stay in insert mode.

So,try add this to vimrc but it doesn't work.

noremap! < A-h > < left >

noremap! < A-j > < down >

noremap! < A-k > < up >

noremap! < A-l > < right >

any ideas ? :)

Upvotes: 3

Views: 865

Answers (2)

Zeitvertreib
Zeitvertreib

Reputation: 119

I use xmodmap to achieve such behavior, but I use Caps instead of Alt.

see solution on Superuser.

Upvotes: 0

mihai
mihai

Reputation: 38573

Correct usage is:

inoremap <A-h> <left>
inoremap <A-j> <down>
inoremap <A-k> <up>
inoremap <A-l> <right>

Upvotes: 1

Related Questions