Skip to main content
3 of 3
added 2 characters in body
nobe4
  • 16.3k
  • 4
  • 50
  • 83

Undo <CR> in insert mode

Sometimes in insert mode I hit <CR> by mistake and I have to hit the backspace multiple times (depends on the indentation) to get back where I was.

e.g.

<div>
  <p> This is some text []</p>
</div>

The cursor is [] and I hit <CR> :

<div>
  <p> This is some text 
  []</p>
</div>

Now I have to hit backspace twice to get back to the previous line (this case isn't so bad but it doesn't have a lot of indentation).

Do you know a better way to do ?

nobe4
  • 16.3k
  • 4
  • 50
  • 83