So I've just begun switching to Vim after using emacs for six years. It's been rough but what really bugs me is how badly auto-indent fails with web components & custom elements. I tried using xml mode but that chokes on void elements.
I've made a patch that adds support for <template>, <shadow> and <content>, as well as <any-custom-tags>, so that instead of this:
<section>
<paper-dropdown-menu label="Your favorite pastry">
<paper-dropdown class="dropdown">
<core-menu class="menu">
<template repeat="{{pastries}}">
<paper-item>{{}}</paper-item>
</template>
</core-menu>
</paper-dropdown>
</paper-dropdown-menu>
</section>
vim will give you this:
<section>
<paper-dropdown-menu label="Your favorite pastry">
<paper-dropdown class="dropdown">
<core-menu class="menu">
<template repeat="{{pastries}}">
<paper-item>{{}}</paper-item>
</template>
</core-menu>
</paper-dropdown>
</paper-dropdown-menu>
</section>
I've uploaded the
updated html.vim here, which you can add to your vim/runtime/indent or $VIMFILES/indent/ to get this behavior.
This is my first attempt at editing vimscript so use at your own risk! Of course if anyone has run into this issue before and come up with a better solution, please let me know.
Thanks,
Michael