Mapping arrow keys in Vim

When remotely editing through Vim on a friend’s server, I had troubles using the arrow keys, because instead of moving the cursor, using them result in some random letters printed on the screen. After some researches I stumbled on this help (:help compatible_):

This option has the effect of making Vim either more Vi-compatible, or
make Vim behave in a more useful way. When a ".vimrc" file is found while Vim is starting up, this option is switched off, and all options that have not been modified will be set to the Vim defaults.

So the point is, if you have the same problems I had, you don’t want to be Vi-compatible. So simply go and touch ~/.vimrc (this will create an empty .vimrc file in your $HOME directory).

There are also other cool tricks you can do for mapping arrows keys:

Technorati Tags:

Thanks a lot! The arrow keys

Thanks a lot! The arrow keys were driving me mad!

Your post helped me a lot.

Your post helped me a lot. Thanks!!!

Opinion

There are lots of sites where you can find some pdf files, but there is the one site which can help to find necessary pdf file in a few seconds. it is http://www.pdfqueen.com pdf SE.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.