Arrow keys spontaneously stop working in vim

Found in James Hodgkinson's blog, the following command works for me. Note it will refresh the vim screen.

:!reset

I have run into this problem a few times as well. I happened to be running GNU screen on another computer that I was logged in to via SSH. To fix the problem, I detached my screen(s) (Ctrl-a d), logged off of the machine, logged back in, and reattached using screen -x. It may work without logging off of the machine, just by detaching and reattaching screen. I cannot remember though.


In the path /usr/share/vim/ I found the .vimrc file... There I added the line

set term=ansi 

It worked for me. Now the arrow keys are working properly in Vim editor.

Tags:

Vim