Hitting arrow keys adds characters in vi editor
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 fix the problem for you. :)
Installing the vim
package will fix the problem:
sudo apt-get install vim
There are many good vim/vi tutorials on YouTube, or the web generally. For your problem, see the article 8 Essential Vim Editor Navigation Fundamentals.
Then continue to open files as usual:
vi desired-file