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

Re: Distinguishing between GUIs

Expand Messages
  • Benji Fisher
    ... Well, that is pretty clever. I like it! I think you could leave off the .* on either end. I think the official way has got to be if has( gui_mac )
    Message 1 of 2 , Feb 21, 2004
    • 0 Attachment
      On Sat, Feb 21, 2004 at 07:15:52PM -0500, Gregory Seidman wrote:
      > I use both the Carbon GUI and the X11 GUI and, of course, they both look
      > at the same .gvimrc in my home directory. I want my .gvimrc to be able
      > to tell which GUI is being run so that I can set the font differently.
      > I've found a way, but it's a nasty kludge and I'd like a cleaner way.
      > What I'm currently doing is this:
      >
      > if &helpfile =~ ".*/Vim.app/.*"
      > "Mac font stuff
      > else
      > "X11 font stuff
      > endif
      >
      > Yuck! Anyone have a better solution?
      >
      > --Greg

      Well, that is pretty clever. I like it! I think you could leave
      off the ".*" on either end.

      I think the official way has got to be

      if has("gui_mac")
      " Carbon stuff
      else
      " X11 stuff
      endif

      You can also test has("mac") or "macunix" or "gui_gtk". (I do not have
      an X11 version on my mac. It does use the GTK GUI, does it not?)

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.