How to disable 'vi compatible' mode for Vim in Cygwin on Windows 8?
cygwin, vim
Solution
Create a `~/.vimrc` file with the following contents to put vim in nocompatible mode (actually the mere presence of the file is sufficient.)
set nocompatible
The behavior you are seeing is how `vi` used to behave. These are not bugs.
Take a look at `:h nocompatible`
In vim compatible mode tries to emulate vi as closely as possible.
- `--insert--` is not part of vi so it not shown in compatible mode.
- I believe vi did a lazy redraw of the screen and didn't update until you exited back to normal mode. Also backspace is only usable also only works on stuff that was entered in the current insert mode. Overall its not very user friendly.
- The arrow keys are sent to vim as escape sequences (escape followed by a coupled of letters). Let `^[` be escape. `^[OA` is up on my computer its probably something similar on yours. vim sees this as an escape (goes back to normal mode), and O (add a line above the current) and A which is the A you see entered onto your screen. This just means that vim in compatible mode does not interpret the escape characters properly. Most likely because vi did not interpret them (nor was it designed to use them).
`set nocompatible` fixes problems 1 and 3.
I think `set backspace=indent,eol,start` should fix problem 2.
Problem
I am using Cygwin 1.7.22 (32-bit) on Windows 8 (64-bit). Within Cygwin, I am using Vim 7.3.1152, which is the default version. Behavior that seem like bugs: When I press I to enter insert mode, it does not say `-- INSERT --` in the bottom left. In fact, it doesn't say anything. It does behave correctly, though. When I delete letters using Backspace in insert mode, the letters do not disappear but the cursor does move to the left. When I use the arrow keys in insert mode, it enters the letters A, B, C, and D, rather than moving the cursor. The arrow keys work normally outside of insert mode. How do I make Vim behave as I expect?