If you are sure that you will use a Unix-like operating system, you can use
let os = substitute(system('uname'), "\n", "", "") if os == "SunOS" " Do Sun-specific stuff. ... elseif os == "Linux" " Do Linux-specific stuff. ... endif
In any case, you can use the has () command to check if any function is supported; for more information, see
:help has()
source share