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
<https://github.com/michaelpg/vim/blob/patch-1/runtime/indent/html.vim>,
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
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/942c4710-4c3a-4597-86b0-5012ece10cfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.