Tuesday, March 3, 2015

Re: .gvimrc vs. .vimrc

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'".

I may well be doing something wrong or unconventional in my
colorscheme file, but I've tried to follow the recommended patterns
for such files. My goal has been not only to set highlighting I
like, but to have it consistent in all my environments: vim and
gvim; Windows, Cygwin and Linux; locally and over SSH connections.
I don't change most of Vim's default colors, though.

Regards,
Gary

--
--
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:

Post a Comment