I use my .vimrc file on my laptop (OS X) and several servers (Solaris & Linux), and could hypothetically someday use it on a Windows box. I know how to detect unix gene
I'm doing the same thing you are. Don't try to detect the OS. Instead, try to detect the type of vi/vim.
Check :h feature-list for a full list of the conditionals you can use.
Here's what I use to detect MacVim in my vimrc:
if has("gui_macvim")
set guifont=Monaco:h13
endif
With this, you can detect for gvim, vi, vim, and whatever other flavors you might use. The nice thing is that you could have vim-compatible settings on OS X.
Reference from Vim Mailing list
EDIT: This approach and its variants (has('mac'), has('macunix'), has('gui_mac'))do not work for vim in OS X. If you use only use MacVim, you're safe. If you're weird like me and like to occasionally jump into vim, one of the other solutions may be more suitable.