When the cursor is placed at the end of a line containing nothing but withspace characters, vim will, when i press enter, remove that whitespace. I find this irritating, as
The Vim wiki suggests this:
inoremap x
because the indenting is not removed if some text has been entered on the line, even if it has been deleted.
[EDIT - milimetric]
Just a couple of pieces missing from a full solution. You also need remaps for o and O and whatever else you use to add lines:
inoremap x
nnoremap o ox
nnoremap O Ox
Same idea but people newer to vim might not figure it out quickly.