'Vim - Delete blank line using backspace in insert mode

When my cursor is placed at the start of an empty line and I press the backspace key while in insert mode, I'd expect it to wrap the the previous line. However it stays in the same line and does nothing.

I can't seem to figure out what I should add to my .vimrc file to fix this.

enter image description here

vim


Solution 1:[1]

You can set backspace option:

:set backspace=indent,eol,start

Or

:set bs=2

Solution 2:[2]

Are you by any chance working from a windows system? using putty for example?

Sometimes I've seen terminal emulators on windows mess up backspace, so it "sorta" works. Eg. in putty, there a setting under "terminal -> keyboard" for changing how backspace works. Try that.

Solution 3:[3]

If you manually install Vim, no matter where you are on Debian, or

Ubuntu, or even other platform, please add the below code to your

~/.vimrc(The below code works on my Debian manually installed Vim):

set backspace=indent,eol,start

After set nocompatible " be iMproved, required under ~/.vimrc.

Notice: set backspace=2 Do Not Work on my Debian manually installed Vim.

My Debian Manually installed Vim version is: 8.2.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kev
Solution 2 thelogix
Solution 3 Vittore Marcas