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
Written by David North
Related protips
2 Responses
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
·
Never knew that.. cheers for sharing :)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#