On 14/11/12 01:15, Benjamin Klein wrote:
> I could be dreadfully wrong about this but tag-closing functionality seems like a rather small feature to be available only in its own specific plugin. I therefore ask out of curiosity: Are there any other plugins that handle this?
I don't know; but this "small" plugin will search backwards as far as
necessary for the latest unclosed open tag, and give an error if it
finds an opening tag not matching what was expected from a
not-yet-opened closing tag: put the cursor just before your </html> tag
then hit Ctrl-_ and if (possibly after some time) the plugin inserts
</html> with no error, it means you haven't left any mismatched tags in
the whole document. Otherwise (assuming you have a properly closed
</body> tag) it will try to stop with the cursor near the place where
you opened a tag which you have forgotton to close.
This plugin has a provision for "optionally closed" HTML tags (<p>,
<li>, <tr>, <td>, etc.); you may customize the list. XML of course
allows no such optionally closed tags: you have to either specify
explicitly that a <tag/> will have no content, or else <tag>open and
close it</tag> explicitly.
A similar small-but-not-so-small plugin (distributed with Vim) is the
matchit plugin, which will move the cursor from an open or closed
bracket or word to its mate depending on the file's syntax.
Best regards,
Tony.
--
Afternoon, n.:
That part of the day we spend worrying about how we wasted the
morning.