Loading ...
Sorry, an error occurred while loading the content.

Re: Getting the platform/OS from inside vim

Expand Messages
  • Tony Mechelynck
    ... There are so many different has() features for Dos/Windows platforms, usually I write if has( unix ) this is Unix-like (Linux, or maybe OSX) else we re
    Message 1 of 4 , Feb 25, 2009
    • 0 Attachment
      On 24/02/09 15:09, Ben Fritz wrote:
      >
      >
      > On Feb 24, 4:08 am, Paddy<patrick.olough...@...> wrote:
      >
      >> So what's the best way of finding what platform you are on in vim? I
      >> know I can do it using one of the scripting interfaces, but what about
      >> in normal vimscript?
      >
      > has('win32'), has('win16'), etc.
      >
      > :help has()
      > :help feature-list

      There are so many different has() features for Dos/Windows platforms,
      usually I write

      if has('unix')
      " this is Unix-like (Linux, or maybe OSX)
      else
      " we're probably on Windows (or maybe Dos)
      endif

      Some more exotic names are available, such as "win32unix" for Cygwin,
      "macunix" for OSX, etc., but usually the blanket has('unix') is good enough.


      Best regards,
      Tony.
      --
      This is the story of the bee
      Whose sex is very hard to see

      You cannot tell the he from the she
      But she can tell, and so can he

      The little bee is never still
      She has no time to take the pill

      And that is why, in times like these
      There are so many sons of bees.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.