gvimdiff default color scheme

122 views
Skip to first unread message

Roy Fulbright

unread,
Oct 29, 2009, 3:55:20 PM10/29/09
to Vim_Use Googlegroups.com
How can I specify a default color scheme for gvimdiff that is different from my default color scheme when opening a single file? Thanks.

New Windows 7: Find the right PC for you. Learn more.

John Beckett

unread,
Oct 29, 2009, 5:52:10 PM10/29/09
to vim...@googlegroups.com
Roy Fulbright wrote:
> How can I specify a default color scheme for gvimdiff that is
> different from my default color scheme when opening a single
> file? Thanks.

If you mean a particular file has a different color scheme:
http://vim.wikia.com/wiki/Change_the_color_scheme_to_show_where_you_are

John

Roy Fulbright

unread,
Oct 29, 2009, 11:07:10 PM10/29/09
to Vim_Use Googlegroups.com
> What I want is for gvim to use colorscheme A for normal editing and to use colorscheme B for gvimdiff.
 


Windows 7: Simplify your PC. Learn more.

John Beckett

unread,
Oct 30, 2009, 2:55:46 AM10/30/09
to vim...@googlegroups.com
Roy Fulbright wrote:
> What I want is for gvim to use colorscheme A for normal
> editing and to use colorscheme B for gvimdiff.

Probably this in your vimrc would suffice:

if has('gui_running')
colorscheme B
else
colorscheme A
endif

John

Christian Brabandt

unread,
Oct 30, 2009, 3:00:33 AM10/30/09
to vim...@googlegroups.com
On Fri, October 30, 2009 4:07 am, Roy Fulbright wrote:
> What I want is for gvim to use colorscheme A for normal editing and to use
> colorscheme B for gvimdiff.

If I am not mistaken, this should work:

if v:progname =~ "vimdiff"
colorscheme a
else
colorscheme b
endif

But this does not seem to work on Windows, cause the gvimdiff.bat file,
simply calls gvim. Oh well, may be, this works for Windows as well:

if &diff
colorscheme a
else
colorscheme b
endif

Or, if you want a more dynamic approach, this might work as well

colors a
au FilterWritePost * if &diff | colors b | else | colors a | endif
au BufLeave * colors a


regards,
Christian
--
:wq

Christian Brabandt

unread,
Oct 30, 2009, 3:35:24 AM10/30/09
to vim...@googlegroups.com
On Fri, October 30, 2009 8:00 am, Christian Brabandt wrote:
> au BufLeave * colors a

Sorry, I meant BufWinLeave

regards,
Christian
--
:wq

Reply all
Reply to author
Forward
0 new messages