In vim with smartindent on:
- press enter after say a if statement
- type in {
- press enter twice
- type in }
- if you hit up and go to the previous line, indentation is removed from the blank line.
Even the vim documentation says that "If you do not type anything on the new line except <BS>
or CTRL-D
and then type <Esc>
, CTRL-O
or <CR>
, the indent is deleted again."
My question - is there any way to keep this indentation and not have it deleted?