arpit
arpit

Reputation: 788

Two different colorscheme for vim based on GUI and Terminal version of Macvim

I use gui version of macvim for my general development activites. I use mvim from terminal also as I've mapped mvim to vim alias.

How can I open different color scheme in mvim based on whether they are opened in gui version or terminal version?

I want to set solarized colorscheme for gui version of macvim and grb256(or anyother) colorscheme in terminal version of mvim.

How can we do this ?

Upvotes: 1

Views: 1966

Answers (1)

Dan Lowe
Dan Lowe

Reputation: 56548

if has("gui_running")
    colorscheme solarized
else
    colorscheme grb256
endif

And you can set any other things in there you prefer. This is the full block from my .vimrc:

if has('gui_running')
    let g:solarized_contrast = 'high'
    set guifont=Mensch:h14
    set antialias
    set background=light
    colorscheme solarized
else
    set background=dark
    colorscheme cobalt2
endif

Upvotes: 3

Related Questions