Try enabling the autoindent
option:
:set autoindent
or:
:set ai
Explanation from Vim manual:
'autoindent' 'ai' boolean (default off)
local to buffer
Copy indent from current line when starting a new line (typing <CR>
in Insert mode or when using the "o" or "O" command).