0

I am using cygwin to run "linux command line" on windows 10. But here, backspace key doesn't work in insert mode. I had to edit my .vimrc file by setting "nocompatible and "bs=2" to make it work (by watching a youtube tutorial). But why it doesn't work by default? Is this normal behavior of Vim? Do backspace doesnt work on actual linux also??

  • Possibly, your Vim was in compatible mode. So you had to configure it for nocompatible mode – Christian Brabandt Nov 2 '18 at 6:34
  • @ChristianBrabandt but i didn't set it in compatible mode? – Hariom kushwaha Nov 2 '18 at 19:12
0

Backwards compatibility (with vi, and also with earlier Vim releases) is a big thing in Vim. However, there have been many complaints like yours in the past, so Vim 8.0 introduced a :help defaults.vim configuration that gets activated if there's no user configuration.

As you can see in :help 'backspace', the default is an empty option, and defaults.vim sets this to indent,eol,start (which you should use instead of the deprecated and difficult to understand value 2).

'backspace' 'bs'        string  (default "", set to "indent,eol,start"
                                                            in |defaults.vim|)
                        global

defaults.vim has other sensible settings, and can be combined with customizations in your own ~/.vimrc; it's worth to have a look!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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