For fun I decided to compile vim from source. Long story short the build seemed to go fine, but when I enter insert mode I cannot use the <BACKSPACE> key to delete existing characters or newlines created using the <ENTER> key in insert mode. The distro's pre-built package does this just fine. I also know there's no problem with the backspace key itself because I can backspace over characters I've just typed, just not existing characters.
It almost makes sense, as vim operates on a per-line basis most of the time. Is there a flag I need to set in order to support this behavior? Or is it faster by design to enter normal mode to delete existing characters/newlines?
To fix “not working” backspace key in the insert mode permanently, add set backspace=indent,eol,start command to vi / vim configuration file in your $HOME directory.
Backspace in vim is done with X (and delete with x ), but often what you really wanted to do was db for example to delete until the beginning of the word, or daw to delete the whole word etc.
vi/vim editor FAQ: What is the vi/vim backspace key? In Vim, you delete the character under the cursor using the 'x' key while in command mode (which is the equivalent of a [delete] key), and to delete characters to the left of the cursor -- which is the equivalent of a vim backspace key -- use the capital letter 'X'.
Once in insert mode, you can type in your text. Press ENTER at the end of each line. Use Backspace to delete to the left of the cursor. If you need to move the cursor to another line, or make a change, or pretty much anything else, you need to press ESC to get back to Command mode first.
Wow, second time I've figured out the answer minutes after posting the question.
set backspace=indent,eol,start
Must have been set automatically by the distro's package vimrc. Hope this answer helps someone else! For more info:
:help i_backspacing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With