N.B. Although both previous answers gave me enough information to figure out how to solve the problem (and received upvotes from me), neither actually gave the full answer. So that others with the same question don't have to do the research, I'm adding my own answer. However, if @googletorp or @Azz edit their answer to include this info, I'll remove my answer and accept theirs.
The output to
:h feature-list suggests that you should be able to use
has("macunix"), but the latter doesn't work in the version of Vim included in OS X. (It does, however, work in MacVim.)
Here is what I ended up using:
"Windows options here
let s:uname = system("uname")
if s:uname == "Darwin\n"
"Mac options here
has("win32") worked for me, even in 64 bit Vim on 64 bit Windows.
You could also use similar tests of
uname within the
if has("unix") block to distinguish other flavours of Unix. Just run
uname -a from the command-line to see what you need to compare
s:uname with. See also
:h matchstr() if you need to compare just a part of