Adriaan wrote:
Dear Vim Wizards,

I've a text which is tagged with an XML/HTML like syntax, like this:

Lorem ipsum <A> dolor sit amet, consectetur adipisicing </A> elit, sed
<B> do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis </B> nostrud exercitation ullamco <D>
laboris nisi ut aliquip <E> ex ea </E> commodo consequat. Duis aute </
D> irure dolor in reprehenderit ...

Now I want vim to highlight the text between <A> and </A> with red,
<B> and </B> with yellow, <D> and </D> with blue and between <E> and </
E> with green.

Adriaan,
Before writing your own, you might have a look at the following plugin:

Txtfmt (The Vim Highlighter)
http://www.vim.org/scripts/script.php?script_id=2208

Txtfmt will give you the highlight regions you mentioned and a lot more: e.g., up to 8 foreground and 8 background colors (independently configurable), and all combinations of bold, underline and italic. (There's also a configuration that supports standout, reverse and undercurl, but it's currently mutually exclusive with use of background colors). Moreover, each of the "tags" used by Txtfmt are only a single character wide, are hidden by the syntax (for mostly WYSIWYG highlighting), and can be inserted with very intuitive mappings.

Hope it helps...
Brett Stahlman


How would I go about writing a script and/or a syntax file for this?
I've read a little bit around, but I just can't figure this one out.

Thanks in advance!

Adriaan.


--
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

Reply via email to