I'm having trouble with vim wanting to treat the p
element as an inline element rather than a block level one. What vim's auto indent should produce is:
<body>
<p>
Aaaaaaaaaaaaaa bbbbbbbbbbbbbb cccccccccccccccccccccccccccccccc dd
eeeeeeeeeeeee ffffffffffffff gggggggggggggggggggggggggggggggg eee
<p>
</body>
but when typing this out and going to the second line in the paragraph, vim will move the indentation inwards one space like so:
<body>
<p>
Aaaaaaaaaaaaaa bbbbbbbbbbbbbb cccccccccccccccccccccccccccccccc dd
eeeeeeeeeeeee ffffffffffffff gggggggggggggggggggggggggggggggg eee
<p>
</body>
I think this is because most people write their html like this:
<body>
<p>Aaaaaaaaaaaaaa bbbbbbbbbbbbbb cccccccccccccccccccccccccccccccc
eeeeeeeeeeeee ffffffffffffff gggggggggggggggggggggggggggggggg<p>
</body>
How can I get around this and make vim format all block level elements in the same manner?
:help html-indent
.