I’ve got vim plugin that runs on different machines and sometimes needs to do things differently depending on whether it’s Windows, Linux, Mac.
What’s easiest way to test for the operating system? I know I could parse the output of :version command. Is there something simpler that will reveal the OS?
From google:
You can use
has()and the list of features under:help feature-listtodetermine what type of Vim (and therefore under which OS is running).
Search for “version of Vim” from the feature-list help topic and that
should bring you to the different versions for which you can check.