Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim - Delete blank line using backspace in insert mode

Tags:

vim

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

like image 414
matanc1 Avatar asked Feb 17 '26 13:02

matanc1


2 Answers

You can set backspace option:

:set backspace=indent,eol,start

Or

:set bs=2
like image 73
kev Avatar answered Feb 20 '26 03:02

kev


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.

like image 23
Vittore Marcas Avatar answered Feb 20 '26 03:02

Vittore Marcas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!