On 10/25/06, Martin Krischik <[EMAIL PROTECTED]> wrote:
Am Mittwoch, 25. Oktober 2006 18:12 schrieb Tim Chase:
> > for my font plug in I need to know which OS I am running on to
> > choose an appropriate font.  Now when Sun Solaris where added
> > to the list of OS I use I run into a little problem:  there is
> > only "has('unix')" - but that's not good enough as Linux
> > allows for anti alias fonts and Sun Solaris does not.
>
> Perhaps something like
>
>       if has('unix')
>               let os = system('uname')
>               if os ~= 'Linux'
>                       " do linuxy stuff here
>               elseif os ~= 'Solaris'
>                       " do solarisy stuff here
>               endif
>       endif
>
> would do the trick?

sure it would - but it also means calling an external program at startup.
Well, if all else fails...


system('uname') measures as 2 millisec on my Linux.  If this is
still bothering you (vim startup time can be  ~0.10-0.2 sec
because of plugins), you can

1. read /proc/version file and analyze the contents

2. use vim's libcall(): make your own shared library
with a function that calls uname(), and call it via libcall()

3. use perl interface, and invoke perl's POSIX::uname()

Yakov

Reply via email to