On 2007-04-12, Kirk <[EMAIL PROTECTED]> wrote:
> Is there any simple way to have custom blocks of code highlighted and the
> remaining code outside the blocks not highlighted?
> For example:
>
> # file.txt
> some plain text
> [my-custom-tag] some custom text [/my-custom-tag]
> Some more plain text
> ...
> # end of file
>
> So the idea would be to open VIM using file.txt and the code inside the
> custom tags would be highlighted.
How about this?
match Todo '\[my-custom-tag]\zs\_.\{-}\ze\[/my-custom-tag]'
where you can certainly choose some highlight group other than Todo.
You can put that line just as it is into your .vimrc, or put it in
an after/ftplugin/txt.vim file, or create an autocommand to invoke
it on just the files you want.
HTH,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
| Spokane, Washington, USA