My Vim on MinGW 4.6.2 is behaving weirdly, for example, pressing Backspace in insert mode deletes characters, but I have to move the cursor with arrow keys before the deleted characters disappear, and it also takes me out of insert mode.
Another example, pressing Del to delete characters sometimes generates weird characters like changing lowercase characters to uppercase, or corrupts the next character that I key in, for example pressing ‘S’ gives me ‘$’ initally.
Am I using Vim wrong or something? I’m not too unfamiliar with Vim so I’m not sure if this is default behaviour, but the typical Vim behaviour as I understand is like the Vim in Git Bash, where Backspace and Del work like they do in NotePad.
The thing is, backspace is often
^Hand delete is often^?— and some idiot terminals swap the two or have both provide the same character. When some terminals are really wrong, a keypress will generateESC~<something>and theESCwill putviminto command mode, then the~will swap the case of characters, and so on.You’ve also got the
terminfoortermcapdatabases of terminal capabilities to contend with — if yourTERMenvironment variable does not match the running terminal exactly, the wrong capabilities will be selected and the application will generate the wrong escape sequences to properly control the terminal.Of course, running on Windows further complicates everything because terminals aren’t very native to the platform —
CMD.EXEdoes its own thing,MSYSdoes another, andvimis probably expected bog-standardCMD.EXEjust because it is quite common.All these are reasons why I’d recommend using
gvim; it starts a GUI window that behaves almost exactly like the text-modevim, but it is much more predictable in its behavior and you can configure it entirely withingvim— fixingvim‘s behavior might actually mean changing theMSYSconfiguration, which may break other programs. I dislike the waygvimstarts a “new context” rather than just editing in the environment I’m already using butgvimfeels way less awkward under Windows.