Tuesday, August 25, 2009

Re: NONE vs fg/bg as color in highlight.

pwgen 写道:
>> NONE is different from fg/bg, NONE means "don't change", so the color
>> will be the current color instead of the Normal color.
>
> If Normal's foreground/background isn't defined,
> then NONE is the foreground/background color of console, gui, xterm
> (which is defined, for example, with -fg/-bg)
> else if Normal's foreground/background defined,
> then NONE is the foreground/background color of Normal.
NONE is not the fg/bg color of Normal, it has no relationship with
Normal color, although it "happens to be Normal color" in many cases.

>> For example if you define hi Visual guibg=Cyan guifg=NONE, the guifg
>> will be the original highlighted color when selected (test and you will
>> know the difference)

try this:
create a file named hello.c

#include <stdio.h>
int main() { printf("Hello, world\n"); }

write the file and reopen it with vim, you will see syntax highlighting.

:colo default

:hi Visual guibg=Cyan guifg=fg

you can then use v to select the whole file. you will see all text
foreground highlighted with Normal guifg as guifg.

:hi Visual guibg=Cyan guifg=NONE

you can then use v to select the whole file. you will see all text
foreground highlighted with what it should be highlighted, instead of
Normal guifg.


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

No comments: