Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Wrong Indent When There Is Dash - in Html Tag

When I have my custom html tag with the dash in it, Vim can't indent it correctly.

<my-tag>
<my-sub-tag>
    this is my tag
    </my-sub-tag>
    </my-tag>

Also if I remove the dash out, Vim also indents incorrectly.

<mytag>
<mysubtag>
this is my tag
</mysubtag>
</mytag>

Unless I have standard html tags, then VIM can indent it correctly like below:

<h1>
    <p>som text</p>
</h1>

So how can I force VIM to indent <my-tag> and <mytag> correctly like the standard HTML tag?

Thanks

like image 650
Vicheanak Avatar asked Dec 03 '25 17:12

Vicheanak


1 Answers

I have tested html5.vim plugin and it solves this problem.

like image 162
Imran Ali Avatar answered Dec 06 '25 11:12

Imran Ali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!