I’ve moved from using MacVim to using vim in terminal on my MacOs Lion and I’ve realized that both:
has('macunix')
has('mac')
return false instead of true (they work fine within MacVim).
This is an issue because I use the same .vimrc on my Mac and on my Archlinux linode and need to set specific options based on the OS.
The only solution I could dig so far is to use the hostname() function to get the machine name and map it on a specific OS but it is not as elegant as being able to check the OS itself.
Anybody knows why the has(‘…’) commands don’t work as documented?
I agree with Randy Morris, use MacVim’s bundled CLI executable.
However, here are a few lines from my
~/.vimrc:On Mac OS X,
$ unamereturnsDarwinwhen in X11/XQuartz andMacotherwise.