2

When I open a new file using vi command:

vi <new file name>

After entering into file and typing the data I am getting the characters like A, B, C, D when I use <, > arrows in order to move up the line or down the line

muru
  • 193,181
  • 53
  • 473
  • 722
  • 1
    vi was an editor written back when terminals (or their keyboards) didn't all have arrow keys so h-j-k-l keys performed the movement options. `vi` is smaller so is installed by default; most of us grab `vim` even if we don't use vim's extra features - because we aren't still in the 70s or early 80s. – guiverc May 19 '18 at 06:42
  • 2
    Possible duplicate of [Hitting arrow keys adds characters in vi editor](https://askubuntu.com/questions/353911/hitting-arrow-keys-adds-characters-in-vi-editor) – muru May 19 '18 at 07:53

2 Answers2

3

Alternative way to solve this is by creating a vimrc file:

# vi ~/.vimrc

And adding the following line in it:

set nocompatible

This should fix your issue.

rootameen
  • 106
  • 1
  • 7
2

I solved it by installing vim:

sudo apt-get install vim