I often accidentally press Enter while typing in insert mode. To undo the accidental new line, I typically press Backspace several times, first to remove all the automatic indentation, and then, finally, to remove the accidental new line.
Is there a better way to achieve this? Perhaps something like undoing the effects of the last pressed key?
In the exact same situation, I do <C-w><C-w>
. <C-w>
is a great asset to have in insert mode.