On Mon, Jun 7, 2010 at 2:01 PM, <[email protected]> wrote:

> Is it possible to have Vim set the background colour of a multi-line block
> of code surrounded by preprocessor directives? For example (C code):
>
> int func1() {
>   int i;
>   for (i=0;i<MAX;i++) {
>      func2(array[i]);
> #if DEBUG
>      printf("Called func2 with %d\n",array[i]);
>      debugfunc(i);
> #endif
>   }
>   printf("func1 all done\n");
> }
>
> I'd like the 4 lines between #if and #endif inclusive to have a different
> background colour. I don't mind if those lines keep or lose their regular
> syntax
> colouring, it's more important to me just to have them stand out as a
> visually
> distinct block.
>
> If there are any examples of syntax files that do this that I could copy
> from
> that would be ideal - realistically I won't have time to learn the nuts and
> bolts
> from scratch.
>
> Thanks...
>
> --
> 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


I think you can try Ifdef script on
http://www.vim.org/scripts/script.php?script_id=7
Hope it's helpful.

Best Regards,

Gusman.DP

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