Are cygwin vim commands different than normal vim

cygwin;vim

I am unable to edit text files using vim in cygwin.

I have to press i many times to insert text. Sometimes it works and sometimes doesn't. Whenever I move cursor up down I have to press I many times.

What could be the problem? Does backspace work in cygwin?

Best Answer

Cygwin vim ships with vim's default configuration, which leaves vim in vi compatibility mode where it tries to emulate the original vi as closely as possible. Among other limitations, arrow keys do not work in that mode, and backspace just moves the cursor left rather than erasing a character.

Creating an empty ~/.vimrc is sufficient to disable vi compatibility mode:

touch ~/.vimrc

Having said that, i to enter insert mode should work anyway. You'll need to provide more details on where and how you're running vim. Also, are you actually running the vim that comes with Cygwin, or the native Windows version of vim?

Update

You can add below sets in ~/.vimrc to make is similar to default vim

set nocompatible
set backspace=indent,eol,start
set backup
set history=50
set ruler
set background=dark
set showcmd
set incsearch
syntax on
set hlsearch

If vim does not pick up your vimrc file, it may be looking for a .virc file instead. In this case, rename the file and the changes will be applied.

Related Question