osx - how do I detect OS X in my .vimrc file, so certain configurations will only apply to OS X? -


I use my .vimrc file on my laptop (OS X) and many servers (Solaris and Linux), and It may be hypothetically someday use it on a windows box. I know how usually Unix and windows are detected, but how can I locate OS X? (And for that matter, there is a way to distinguish between Linux and Solaris etc. And is there a list of all the stars that can be 'have'? None of mine came up.)

For example, I would use something like this:

  If there is ("Mac") "Open a file in textMate from vi:" nmap friend: W & LT; CR & gt ;: Partner% & lt; CR & gt; Adif ("Unix") "stuffs under Linux" and "FIX" ("Win32") "do stuff on the bottom of the window" andif  

but clearly "Mac" The string is not,


Update: The answer below ("macunix") seems quite clearly like should work, but for some reason it 't (Maybe Apple did not compile properly to respond to it? It looks like it does not.)

Any rate But I think that I need to change the focus of this question: Does anyone get the solution that ends with what he gets? (I.e., successfully knowing that the .vimrc file is being used on Mac OS X .)

If you (unix) s: uname = system ("uname -s") S: uname == "Darwin" "s: uname ==" darwin "However, to be completely transparent, my actual. Vimrc reads:

  Come on: uname = system ("echo - mainly for locating Linux" (unlike OSX)  

/ P >

I'm not sure that all you have to do is echo -n \ "$ (uname) \" stuff, but at the end it was to do with Newline uname Call your Mileage may be different.


Comments