On Tue, April 7, 2009 2:03 am, Matt Wozniski wrote:
>
> On Mon, Apr 6, 2009 at 5:50 PM, Dan Behman wrote:
>> Hi - is there any way to change the color of only one window when say
>> for example, doing a window split?
>
> I know of no way to do this...
>

Well the thread about highlighting whole lines gave me the idea to use
:signs to change the background color. So you could change the color for
individual files.

So using this script, you could color whole buffers differently:

fu! DoColor(int)
        let identifier="bgColor"
        let highlight="WildMenu"
        if a:int
            call ColorBG(identifier, highlight)
        else
            call UnColorBG(identifier)
        endif
        redraw
endfu


fu! ColorBG(id, highlight)
    exe "sign define " . a:id . " linehl=" . a:highlight
    let lnum=1
    while lnum <= line('$')
        exe "sign place " . lnum . " line=" . lnum . " name=" . a:id . "
        buffer=" . bufnr('')
        let lnum += 1
    endwhile
endfu

fu! UnColorBG(id)
    let lnum=1
    while lnum <= line('$')
        exe "sign unplace " . lnum . " buffer=" . bufnr('')
        let lnum += 1
    endwhile
    exe "sign undefine " . a:id
endfu

Now calling :call DoColor(1), will color the active buffer and
:call DoColor(0) will reset the Color.

The only problem with this approach is, if you add lines to the buffer,
they won't be colored until you do call DoColor(1) again and if you
delete lines, some signs might not be deleted properly.

I am not sure, if this applies to the :scs command though, as I can't
test with cscope currently.

regards,
Christian
-- 
:wq!


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

Reply via email to