On 20/02/09 10:03, MZ wrote:
> Is it possible to set the color scheme such that the bg color for each
> line alternates b/t two colors.

It is possible _provided that_ your syntax script has two syntax groups, 
assigned to alternate lines. (The default syntax scripts for most 
languages don't do that).

I have an owncoded syntax/text.vim (quoted below) which does that for 
text files, but it isn't perfect, on two counts:
- blank lines count as neither "odd" nor "even" and after them, the 
count is reset;
- the default highlights for cterm are awful; you better use an owncoded 
colorscheme if you want to use this in Console mode.

> sy spell toplevel
> sy sync fromstart
>
> sy match textOddLine  /^.*\n/ nextgroup=textEvenLine
> sy match textEvenLine /^.*\n/ nextgroup=textOddLine
>
> if &bg == "light"
>       hi def textOddLine  guibg=#FFFFCC ctermbg=darkmagenta
>       hi def textEvenLine guibg=#FFCCFF ctermbg=darkblue
> else
>       hi def textOddLine  guibg=#666600 ctermbg=darkmagenta
>       hi def textEvenLine guibg=#660066 ctermbg=darkblue
> endif
>
> let b:current_syntax = "text"

Also, there is no filetype detection of "text" by default (my 
~/.vim/after/filetype.vim corrects that) and the vimrc_example.vim sets 
'textwidth' to 78 for text files (my vimrc removes that autocommand).


Best regards,
Tony.
-- 
        An old Jewish man reads about Einstein's theory of relativity
in the newspaper and asks his scientist grandson to explain it to him.
        "Well, zayda, it's sort of like this.  Einstein says that if
you're having your teeth drilled without Novocain, a minute seems like
an hour.  But if you're sitting with a beautiful woman on your lap, an
hour seems like a minute."
        The old man considers this profound bit of thinking for a
moment and says, "And from this he makes a living?"
                -- Arthur Naiman, "Every Goy's Guide to Yiddish"

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

Reply via email to