It is really frustrating when suddenly Vi Editor behaves strangely. While typing arrow keys, the output is A, B, C, D etc. Inserting in usual way doesn't work and backspace doesn't deletes characters in insert mode. Well after searching for a while on internet I found this cool solution:
In home directory, open file .vimrc (create one if not present) and write
"set nocompatible"
save and close the file. On command line enter the command
"source .vimrc"
voila!! life is back to normal!