Tanky Woo
Tanky Woo

Reputation: 5116

How can I use different color schema between vim and gvim

What should I write in my .vimrc file to test whether I am running vim or gvim.

Because the colorscheme I like very much is beautiful in vim, but is ugly in gvim. So I want it that when I am in vim, I use this aforementioned colorscheme, and when I am in gvim, use another colorscheme.

Is there any vimscript code can implement this function?

Upvotes: 6

Views: 2837

Answers (3)

phildobbin
phildobbin

Reputation: 834

from my experiences using the Settings sub menu in gVim does override the gvimrc.

If you want to set the font in gVim add these lines to your gvimrc

set guifont=WhateverFontYouWant\ 011

& substitute the size for the value you require

Upvotes: 0

WilQu
WilQu

Reputation: 7413

gvim has its own configuration file, .gvimrc. Settings that you put in this file will override .vimrc settings for gvim only.

Upvotes: 4

j13r
j13r

Reputation: 2671

These two pages have a lot of info on color schemes and how to switch them: http://vim.wikia.com/wiki/Switch_color_schemes http://www.indelible.org/ink/vim-colorschemes/

It also features the issue you have:

if has('gui_running')
    " GUI colors
    colorscheme foo
else
    " Non-GUI (terminal) colors
    colorscheme bar
endif

Upvotes: 20

Related Questions