cygwin + mintty + vim backspace problem

14

4

I have installed vim, mintty via cywin on XP. The problem is when I try to hit backspace in VIM edit mode, the cursor move back a character instead of wiping the previous char. How can I tweak this odd behavior?

overboming

Posted 2010-03-26T08:48:48.283

Reputation: 337

Answers

13

Cygwin's vim is configured to behave like traditional vi by default. Just create an empty ~/.vimrc, which causes vim extensions to be enabled and hence the Backspace and arrow keys to behave as expected.

ak2

Posted 2010-03-26T08:48:48.283

Reputation: 3 387

Worked for my friend today. – Dan – 2013-04-18T23:31:03.323

19

Add

set backspace=indent,eol,start

to your .vimrc file.

user34487

Posted 2010-03-26T08:48:48.283

Reputation:

6this was infact the solution. not creating an empty $HOME/.vimrc file. Thanks – Felipe Alvarez – 2011-04-06T02:39:35.090

Wiki link, explaining the situation - http://vim.wikia.com/wiki/Erasing_previously_entered_characters_in_insert_mode

– Temikus – 2013-04-05T07:28:53.203

1The empty .vimrc worked for my friend today. I do not have an empty .vimrc, but I also do not have the backspace settings you indicate above, and it works for me. I believe this indicates that for mintty, the empty .vimrc IS the solution. Or in other words, by having any .vimrc at all, the default settings are changed and in fact fix this issue (unless you .vimrc explicitly overrides them, of course). – Dan – 2013-04-18T23:30:32.087

0

Have this same problem with mintty and msys2 by default.

You can just copy the example vimrc config file to your home directory as .vimrc and it fixes everything. It will also enable all the fancy vim features such as syntax highlighting.

cp -vi /usr/share/vim/vim74/vimrc_example.vim ~/.vimrc

Dev

Posted 2010-03-26T08:48:48.283

Reputation: 188