Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 12 down vote accepted

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.

share|improve this answer
1  
Thanks, it works for me now:) –  overboming Mar 26 '10 at 9:35
    
Worked for my friend today. –  Dan Apr 18 '13 at 23:31

Add

set backspace=indent,eol,start

to your .vimrc file.

share|improve this answer
6  
this was infact the solution. not creating an empty $HOME/.vimrc file. Thanks –  Felipe Alvarez Apr 6 '11 at 2:39
    
Wiki link, explaining the situation - vim.wikia.com/wiki/… –  Temikus Apr 5 '13 at 7:28
1  
The 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 Apr 18 '13 at 23:30

Sorry, not enough reputation to comment, but to clarify on the two answers already given:

For me, just adding the empty file (as suggested by ak2) fixed the behaviour described by the OP: pressing backspace now removes the character in front of it.

But, for me, when at the first position of a line, pressing backspace does not remove the new-line character in front of it / it does not merge the two lines (instead it does nothing while giving a complaining beep).

After setting set backspace=indent,eol,start (as suggested by user34487) pressing backspace at the start of the line will remove the new-line character in front of it.

So with both suggestions my Cygwin + vim is notepad.exe compliant, thanks both :-)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.