When editing an html file in vim, the indentation for css inside style
tags is messy.
For instance, this is how it would indent this sample css code without any manual intervention to fix the indentation on my part:
div.class
{
color: white;
backgroung-color: black;
}
Why is this happening? how can I fix it?
I experience the same problem, can't really help but I tend to do is vi{
then 9<<
and finally >>
.
I tried to find a good css indent, but none of the ones I tried seemed to work properly.
This indent script seems to work well (better).
Download it and stick it at ~/.vim/indent/css.vim
You'll need the filetype plugin indent on
line in your .vimrc
file, too, as kamaji suggests.
Now if I could only get it working on .css.less files...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With