Posts tagged ‘vi’

Vi is misbehaving with my arrow keys!

(Note: The following blog entry is for Linux users and may not be of any use to Windows users.  No discrimination intended.)

In my earlier days, I always use nano as my editor of choice whenever I’m on a Linux console because it is easier to use by a person accustomed to using Windows. Later, I have adjusted myself and found vi interesting and easier to use! Ever since, I am solely a vi user until I encountered a difficulty running vi on my hosting server.

The problem is that whenever I open or create a file and start using the arrow keys, I instead got the following:

Up arrow outputs “A” + next line
Down arrow outputs “B” + next line
Right arrow outputs “C” + next line
Left arrow outputs “D” + next line

By googling, I found the solution on Digitalblueprint. So it’s basically creating or editing the .vimrc file on your home folder. Linux home folder is your default folder after logging in to your Linux computer and you can return to the home folder from anywhere by entering the cd, change directory, command without any parameter.

Here’s what you need to have on your .vimrc file:

filetype plugin on
filetype indent on
syntax on

Also after this fix, you would see the normal status messages that shows – INSERT –, – REPLACE – on the bottom of the screen.

Happy vimming!