Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Vim 7.3 does not behave the same way as Vim 7.1?

Tags:

linux

text

vim

vi

I always wanted to ask this question but thought it was somehow my fault. I use Vim at two places: one in Ubuntu and the other in Cygwin.

Ubuntu: VIM - Vi IMproved 7.1 (2007 May 12, compiled May  6 2008 16:24:07)
Cygwin: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 19 2010 13:06:02)

In 7.1, when I go into the Insert mode using Esc-i, I can use the arrow keys and use it as a normal text editor like nano. However, in the other version, 7.3, when I enter the insert mode, I can no longer use my arrow keys or space. When I hit any of them, I get characters like C, D etc. for arrow keys. I might be missing something here but am not sure why the discrepancy and if I can revert back to the way it was before. Any suggestions?

like image 896
Legend Avatar asked Jul 22 '11 07:07

Legend


1 Answers

Usually doing :set nocompatible works: Linux vi arrow keys broken in insert mode

In this case I tried it out in cygwin and you I also needed :set term=ansi to get it to work.

So viraptor pretty much had it, except you want to set NOcompatible:

:set nocompatible
:set term=ansi
like image 60
Nick Knowlson Avatar answered Nov 10 '22 16:11

Nick Knowlson