Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Created July 24, 2017 13:58
Show Gist options
  • Save kurtis318/b344e4cab4764c7eabbb88a536580d0a to your computer and use it in GitHub Desktop.
Save kurtis318/b344e4cab4764c7eabbb88a536580d0a to your computer and use it in GitHub Desktop.
Solution for arrow keys inserting B A and other in vi and vim
I use vi/vim all the time to edit files on Linux. I occassionally I will install a Linux distro and find out that when I use vi or vim, the cursor keys do not work as expected.
I finaly got tired of having to use the nano editor (it's a good alternative) so I did some checking. The following web site had three solutions:
Ref: https://askubuntu.com/questions/353911/hitting-arrow-keys-adds-characters-in-vi-editor
The one that worked was:
export TERM=xterm
Adding the line:
set nocompatible
to either of these three files, did not work for an Ubuntu 16.04.1 on ppc64le:
~/.exrc
~/.vimrc
/etc/vim/vimrc.tiny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment