Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am open a file in vi:

vi index.php

Here the problem is: when I press the down arrow and it prints 'B'. Why it prints 'B'?

share|improve this question
You should not ask something like this on AU but try to find a how-to on vi with google. There are plenty of how-to's on the web. and not only in English but also in your language. – Rinzwind Nov 21 '12 at 8:44
Is there any specific reason for wanting to use vi as editor? I find using gedit (for simple text files) or jedit or geany (for html, php, css files) much easier and user-friendly. – To Do Nov 21 '12 at 10:10
@Rinzwind I don't understand how this question is off topic here? Google sent me here, from here I should go back to Google. Sounds like a vicious circle. – Radu Rădeanu Oct 5 '13 at 7:55
@RaduRădeanu is has nothing to do with Ubuntu :+ – Rinzwind Oct 5 '13 at 8:27
@Rinzwind As far as I know, Ubuntu comes with vi preinstalled. Now these questions about default behavior of Ubuntu programs are off topic here? – Radu Rădeanu Oct 5 '13 at 8:47
up vote 10 down vote accepted

There are three modes in vi editor namely:

  • command mode
  • input mode
  • default mode.

When youu open a file, you are in default mode. Now if you want to go to a specific position in your text, just use arrow keys or use h, j, k, l keys. Note that this would work only when you have not pressed i (or any other input mode entering command like a, A, I).

The reason for 'B' may be because the arrow keys in input mode don't function as arrow keys, so just press Esc to go into default mode any time. When to shift to input mode press i or a, and to navigate just press i key and use arrow keys or h, j, k, l.

share|improve this answer

Also try vim.

$ sudo apt-get install vim

There are many good vim/vi tutorials on youtube, or the web generally. For your problem, see here

share|improve this answer

To disable printing letters on pressing arrows in edit mode you can do following

vi $HOME/.exrc 

(create file if it does not exist) and then add line set nocompatible to it and save.

share|improve this answer
This should be the accepted answer. Thank you! – eis Nov 18 '15 at 10:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.