When I tried to use arrow keys in insert mode in vi editor the following characters are being inserted in the editor.

  • for I get B,
  • for I get A,
  • for I get D,
  • for I get C.

Please help me with this problem

Best Answer

If you don't already have a .vimrc file in your home directory, create one using this.

vim ~/.vimrc

Add this line to the top of the file

set nocompatible

Save the file and this should solve the problem for you :)