4ntiwq
Last Updated: February 25, 2016
·
816
· hobnob
Dave

Making arrow keys work in vim

If your arrow keys are leaving odd characters lying around, rather than moving the cursor you can run this from inside vi or vim:

:set nocompatible

Or you can add this to ~/.vimrc:

set nocompatible
Say Thanks
Respond

2 Responses
Add your response

828
D54f65ad3ff9ee1c9c033a403d4b5f9f

Just throwing this out there, using your arrow keys for movement in vim is a pretty big, if not the biggest, antipattern for vim usage. Practicing by removing them is a good way to get yourself off the habit. There is almost always a better way to move around than a single character motion

no <down> <Nop>
no <left> <Nop>
no <right> <Nop>
no <up> <Nop>
ino <down> <Nop>
ino <left> <Nop>
ino <right> <Nop>
ino <up> <Nop>
vno <down> <Nop>
vno <left> <Nop>
vno <right> <Nop>
vno <up> <Nop>
over 1 year ago ·
833
Dave

Never knew that.. cheers for sharing :)

over 1 year ago ·