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??
1 Answer
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!
compatible
mode. So you had to configure it fornocompatible
mode