On Wed, Jul 22, 2009 at 3:27 PM, Christian Brabandt <[email protected]>wrote:

> See, if this works:
>
>
> hi SignLineBG guifg=white guibg=DarkRed
>
> fu! InitSigns()
>    if has("signs")
>        sign define HiLine linehl=SignLineBG
>        return 1
>    else
>        echohl WarningMsg | echomsg "Signs Feature not available. You need
> at
> least a Big version of vim" | echohl None
>       return 0
>    endif
> endfu
>
> fu! ColorLine(flag) range
>    if InitSigns()
>        for i in range(a:firstline, a:lastline)
>            if a:flag
>                exe "sign place " . i . " line=" . i . " name=HiLine
> buffer=" .
> bufnr(expand("%"))
>            else
>                exe "sign unplace " . i . " buffer=" . bufnr(expand("%"))
>            endif
>        endfo
>    endif
> endfu
>
> comm! -range Color <line1>,<line2>call ColorLine(1)
> comm! -range UnColor <line1>,<line2>call ColorLine(0)
>

Many thanks for your code. I put it in my syntax file c.vim and replaced
both occurencies of SignLineBG with CommentDocu which is defined as
syn region CommentDocu start='/\*\*' end='\*/'
Having issued :syn on, the comments get white on red background, but the
background stops at the last character on each line. Thus, I'd tend to say
that the script is not working properly. Or have I done something wrong?

Thanks, Kašpi.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to