How can I detect the OS?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I detect the OS?

Eddy Petrișor
Hello,

Is there a way to detect the OS on which Vim is running?

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein
Reply | Threaded
Open this post in threaded view
|

Re: How can I detect the OS?

Frank Terbeck
Eddy Petri??or <[hidden email]>:
> Is there a way to detect the OS on which Vim is running?

Hello Eddy,

take a look at
:help feature-list

There are features like amiga, beos, unix and others, which correspond
to the currently running version of vim.

Regards, Frank

Reply | Threaded
Open this post in threaded view
|

Re: How can I detect the OS?

James Vega-3
In reply to this post by Eddy Petrișor
On Wed, Apr 26, 2006 at 02:34:02PM +0300, Eddy Petrişor wrote:
> Hello,
>
> Is there a way to detect the OS on which Vim is running?

You can use has() and the list of features under ":help feature-list" to
determine what type of Vim (and therefore under which OS is running).

  if has('win32')
     ... win32 specific stuff ...
  endif

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.

James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[hidden email]>

signature.asc (204 bytes) Download Attachment