On 08/08/11 19:24, Asis Hallab wrote:
Dear Vimers,

is there any way known to distinguish between different OSs in the .vimrc?

E.g.:

if OS='Mac'
   set gfn=Monaco
else
   set gfn=Monospace
end

Help will be much appreciated!

Kind regards!
Asis

For this particular case, it is more involved than that, since more than the OS must be checked -- the 'guifont' option comes in several incompatible variants which depend not only on your OS but also, for some OSes, on your GUI flavour.

if has('gui') " if not GUI-enabled, 'guifont' cannot be set
        if     has('gui_mac')  " Macintosh including MacVim
                set gfn=Monaco:h10
        elseif has('gui_gtk2') " GTK2 but not GTK1
                set gfn=Monospace\ 10
        elseif has('gui_photon')
                set gfn=Monospace:s10
        elseif has('gui_kde')  " obsolete, but we might get an old build
                set gfn=Monospace/10/-1/5/500/0/0/1/0
        elseif has('x11')      " other X11 including GTK1
                set gfn=-*-courier-medium-r-normal-*-*-100-*-*-m-*-*
        else                   " other, including Windows
                set gfn=Monospace:h10:cDEFAULT
        endif
endif

In each case, the first or only number is the font size: the bigger the number, the bigger the font, vary at will.

See http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI


Best regards,
Tony.
--
Deliberation, n.:
        The act of examining one's bread to determine which side it is
buttered on.
                -- Ambrose Bierce, "The Devil's Dictionary"

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

Reply via email to