开发者

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

I always wanted to ask thi开发者_如何学运维s 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?


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


Try:

:set compatible
:set term=ansi

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


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.


You should write:

set nocompatible

in file: ~/.exrc

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜