Legend
Legend

Reputation: 117020

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

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?

Upvotes: 6

Views: 687

Answers (4)

You should write:

set nocompatible

in file: ~/.exrc

Upvotes: 0

0x4B1D
0x4B1D

Reputation: 933

Don't know if you figured this out. Unfortunately I can't yet add this as a comment, so adding it as answer, try:

:set nocompatible

by itself -- did the trick for me.

Upvotes: 0

Nick Knowlson
Nick Knowlson

Reputation: 7426

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

Upvotes: 2

viraptor
viraptor

Reputation: 34205

Try:

:set compatible
:set term=ansi

(or other terminal - windows one might need "win32")

Upvotes: 0

Related Questions