Are cygwin vim commands different than normal vim?

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.


The easiest way is copy Cygwin VIM's sample vimrc file

cp /usr/share/vim/vim*/vimrc_example.vim /etc/vimrc

This will fix the problem for every account on your system. If, for some reason, you only want to change it for a particular user, do

cp /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc

See reference here


I had problem with arrow keys while trying vim inside Windows 8.1 using cygwin. The issue was, printing A/B/C/D while navigating with Arrow keys in insertion mode. The solution worked for me is:

cp vimrc_example.vim ~/.vimrc

Basically, above command copying vimrc_example.vim file to /home/<user name>/.vimrc.

Tags:

Vim

Cygwin