Changing VI behavior - Arrow Keys

Hi all!

Whenever I install Ubuntu (usually, 11.04 and 11.10) and I have to use VI, I always forget that when VI is in INSERT mode, arrow keys have strage behavior. I like to use arrow keys to move my cursor in the text.

I mean:

  1. Press 'i' to go to Insert Mode
  2. Press any arrow keys
  3. You'll see: "A", "B", "C" or "D", depending on the arrow keys. Cursor does not move as expected.


To change this behavior, I did the following steps:

  1. Open any terminal
  2. Go to your Home directory by typing "cd"
  3. Type "echo "set nocp" > .vimrc"
  4. Open VI again and try to use arrow keys.



Thanks!


References:

  1. http://vim.wikia.com/wiki/Fix_arrow_keys_that_display_A_B_C_D_on_remote_shell

Comments

Post a Comment