Vim keeps unindenting the lines I want to keep indented if I don't write anything on them... I'll give an example, where the | is the caret.
Caret is indented and I press enter
if expression: print("hello world") |
Caret is indented on the next line, and now I press the up arrow
if expression: print("hello world") |
Now the caret isn't indented anymore, what happened?
if expression: print("hello world") |
So how do I keep the indent?
set virtualedit=all
? It doesn't do what you're asking for, but it is roughly similar (see the help page).