tags:

views:

130

answers:

2

Do you have any preferred methodology for managing html formatting tags in vim?

The best I've come up with is creating some macros to insert tags at the current cursor position - ctrl-i for <i>, ctrl-j for </i>, etc.

It would be handy to be able to, say 2w{something} to italicize 2 words, for instance, without needing to navigate the cursor to the end point. The best option I can think of would let me use the same keystrokes I use to so flexibly delete a string of text that might be word count, regex match, etc. but would insert both opening and closing tags.

+2  A: 

Give a look to the surround.vim plugin.

CMS
Classic vim - way overkill except when you quickly find out you need it. Lovely.
le dorfier
+1  A: 

I use Christian Robinson's HTML macros when I have to traffic in raw HTML.

Generally, I prefer to use reStructuredText and generate HTML.

George V. Reilly
I need to work through reStructuredText too; but that's going to take a while and some planning. At first glance it appears to be more comprehensive and conceptually integrated than textile, markdown etc. I'll download and try out the first option first.
le dorfier