Monday, June 3, 2013

How to fix <h1> id strings?

Hi all,

Using snipMate, <h1> items have id strings that are the same as their
text, meaning the id string has spaces.

<h1 id="My h1 item">My h1 item</h1>

This is an HTML4 no-no, so I want to create a Vim something or other so
that, when my cursor is between the quotes delineating the id's value,
it replaces all spaces with underscores.

Another, possibly more useful thing I could do, would be to modify
snipMate's <h1> snippet so I type the visible text and the id follows,
instead of vice versa. I know how to do that. But then I'd need to have
the id replace the spaces with underscores realtime, and I don't know
how to do that.

If anyone can point me to some URLs for doing this stuff, or specific
Vim help pages, I'd be eternally grateful.

Thanks,

SteveT

Steve Litt * http://www.troubleshooters.com/
Troubleshooting Training * Human Performance

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment