Ben K. wrote:

Vimmers,

I use vimdiff in gnome-terminal and sometimes in GUI, but the default color scheme (I found somehow it's not the same as the "colors/default.vim") sometimes use the same color for both foreground and background. Most of the color schemes in the colors directory do the same (same or indiscernible fg and bg colors)

Since $VIMRUNTIME/colors/default.vim includes no explicit highlights, but only resets everything to the defaults, it should be the same as no colorscheme at all... unless

        hi clear Normal
        set bg&
        hi clear

doesn't "guess" correctly whether your background is "light" or "dark". In that case, here's how to reset the defaults, assuming you're running Vim in a dark-background color-xterm:

        hi clear Normal
        set bg=dark
        hi clear
        " the rest of default.vim shouldn't change

Don't modify $VIMRUNTIME/colors/default.vim "in place", because any upgrade may (and, on Unix, probably will) overwrite it without warning. Place your own colourscheme (the modified version) in ~/.vim/colors/ (on Unix) or ~/vimfiles/colors/ (on Windows); I recommend that you also give it another name, but ending in .vim


I spent some time and found corresponding set the following for the c files I have at hand, so I add these lines in my .vimrc, but I guess I'll have to do the same for php and other languages I use.

highlight cConstant ctermfg=white guifg=white
highlight cString ctermfg=white guifg=white
highlight cNumber ctermfg=white guifg=white

I expect that "guifg=white" will set it to white-on-white in most cases when using the GUI


Do these have something in common? I had to try a few times to find what they are...



P.S.)

Also, :help colorscheme  says

:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' for the file "colors/{name}.vim. The first one that
                        is found is loaded.

but somehow, none of my installations do that, if the first means alphabetically the first. Probably it'll be understandable if I look at the code, but just wanted to note here - in case someone has a ready answer.


Happy vimming,

Ben K.
Developer
http://benix.tamu.edu


It's not alphabetically the first, it's the first in 'runtimepath', as follows:

Let's say you use the command

        :colorscheme foobar

on Unix, with 'runtimepath' at its default setting. This is what happens:

If "~/.vim/colors/foobar.vim" is found, use that; otherwise

  if "$VIM/vimfiles/colors/foobar.vim" is found, use that; otherwise

    if "$VIMRUNTIME/colors/foobar.vim" is found, use that; otherwise

      if "$VIM/vimfiles/after/colors/foobar.vim" is found, use that; otherwise

        if "~/.vim/colors/foobar.vim" is found, use that; otherwise

          don't change anything, and if 'verbose' is nonzero give a message.


Best regards,
Tony.

Reply via email to