Tuesday, March 3, 2015

Re: .gvimrc vs. .vimrc

Hi Gary!

On Di, 03 Mär 2015, Gary Johnson wrote:

> On 2015-03-03, Tim Chase wrote:
> > On 2015-03-02 12:11, Gary Johnson wrote:
> > > you should set your :colorscheme in ~/.gvimrc or with a GUIEnter
> > > autocommand because Vim won't know the background color of the GUI
> > > until it starts the GUI.
> >
> > Just for the record, I :colorscheme in my vimrc and it gets
> > identified properly in both vim and gvim. If you only set it in the
> > gvimrc, you don't get your desired color-scheme in (non-g)vim.
>
> I used to set my colorscheme only when my ~/.vimrc was sourced, but
> I would get different results when I executed :colorscheme after
> gvim had started. I solved that problem by setting my colorscheme
> like this (from my ~/.vimrc, with some simplification).
>
> if has("gui_running")
> au GUIEnter * nested colorscheme gaj_default
> else
> colorscheme gaj_default
> endif
>
> > I might be missing something with the 'background' setting being
> > "dark" vs. "light" but since whatever the default is works for my
> > preferences, I haven't tinkered with that.
>
> This is explained in ":help 'background'".

IIRC, some colorschemes set the default Normal highlighting background
to a high color term value. This usually resets the background option.
(There is a bug report about it in the todo list and I think I even made
a patch some time ago), so I usually just reset the background after
setting the color scheme.

However the colorscheme could still look quite different, if your
terminal only has support for 16 or 88 colors or the colorscheme author
did not bother to find good terminal color approximations for gui RGB
colors. (The cs_approx plugin should help here, as you probably know).

Mit freundlichen Grüßen
Christian
--
Die Begierde nach Geld kann sich sogar in einer edeln Seele
entschuldigen - um nämlich von Menschen (nicht bloß von Sachen) frei
zu bleiben, um gegen jene niederwerfende Ungleichheit eine Stütze zu
haben.
-- Jean Paul

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: