Building GUI Vim on MacOS

272 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Jul 9, 2020, 9:41:10 PM7/9/20
to vim_dev
Hi all,

Is anyone able to successfully build GUI Vim on MacOS?

I am not able to build Vim with GUI enabled on MacOS. I tried athena and carbon.
I think the build instructions in src/INSTALLmac.txt file should be updated.

Note that I am able to successfully build MacVim (https://github.com/macvim-dev/macvim)
with GUI support.

Thanks,
Yegappan

Tony Mechelynck

unread,
Jul 10, 2020, 10:37:14 AM7/10/20
to vim_dev
IIUC MacVim is _the_ version of Vim with "native Mac" GUI support. It
/may/ be possible to build other versions of gvim for OSX _with X11_
which is not the default; but AFAIK such versions have received little
or no testing ever since MacVim came into being, their GUI may or may
not still be usable. OTOH the procedure for building Vim without GUI
should be the same, or very similar, on OSX and on other Unix-like
platforms.

Best regards,
Tony.

Yegappan Lakshmanan

unread,
Jul 10, 2020, 11:00:42 AM7/10/20
to vim_dev
Hi Tony,

Thanks for the reply. I do regularly build and use the TUI version of Vim
on MacOS (this is the system I use for Vim development).

If nobody is able to build or use the GUI version on Mac, then we should
remove that code (CarbonGUI).

Regards,
Yegappan

Tony Mechelynck

unread,
Jul 10, 2020, 12:36:47 PM7/10/20
to vim_dev, bjorn.w...@gmail.com, Ben Fritz, Ben Schmidt
I don't use the Mac myself, I'm on Linux; so all I know about Vim on
Mac is hearsay, which I got mostly by following the vim_mac newsgroup
in addition to vim_use and vim_dev; but you aren't the first one who
tried to build a non-MacVim gvim on Mac and failed. Did you get an
executable? If you did, have you tried to run it after starting an X11
server?

I'm adding a few CC of people who "might" know the Mac better than I do.

Best regards,
Tony.

Ben Schmidt

unread,
Jul 11, 2020, 3:28:59 AM7/11/20
to Tony Mechelynck, vim_dev, bjorn.w...@gmail.com, Ben Fritz
Yeah, wow, that stuff is ancient. I didn't even know there was ever a
working Carbon-based GUI for Vim. There is vim-cocoa which was an
alternative to MacVim, but I believe it was poorly maintained, so
although Cocoa is still supported by macOS, you'd have trouble building
and running vim-cocoa. Carbon, being officially discontinued by Apple
now (after being deprecated for a number of years), will be even harder
to build and run.

I guess if there's an Athena-based GUI, it would require
X-Windows/X11/XQuartz, but I'm not aware of that ever running on the
Mac. Indeed, as far as I'm aware, MacVim is currently the only viable
GUI on the Mac.

My suggestion would be to remove the others unless anyone is out there
building recent versions of Vim for legacy OS versions (which is
probably futile, so I doubt it; building an older version of Vim for an
older OS would be a smoother road).

Smiles,

Ben



Kuriyama Kazunobu

unread,
Jul 11, 2020, 6:50:09 AM7/11/20
to vim_dev
To build gVim with Athena, you need to install XQuartz before doing that. Once configure successfully detects required X11 headers and dylabs, make will build that version of gVim just like it does with Linux having X11.

To have gVim with Carbon, they say you need an old Mac machine having a working Carbon (Probably, a machine prior to one for OS X 10.8). As far as I can tell, I've never been able to build that GUI with 10.8 or later.

So, unless you
Regards,
Kazunobu Kuriyama

Bram Moolenaar

unread,
Jul 11, 2020, 8:34:04 AM7/11/20
to vim...@googlegroups.com, Ben Schmidt, Tony Mechelynck, bjorn.w...@gmail.com, Ben Fritz
The gui_mac.c file is full of TODO items. If it's impossible to build
with the current Mac OS, then perhaps we can drop it.

How is MacVim build then? The info is scarce...

--
hundred-and-one symptoms of being an internet addict:
5. You find yourself brainstorming for new subjects to search.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Yegappan Lakshmanan

unread,
Jul 11, 2020, 12:17:32 PM7/11/20
to vim_dev, Ben Schmidt, Tony Mechelynck, bjorn.w...@gmail.com, Ben Fritz
Is anyone willing to work on fixing these issues? Otherwise we can support
only the TUI version on Mac and rely on MacVim to provide the GUI support.

Does anyone see any issues in removing the gui_mac.c file and the support
for building with Carbon on MacOS?

 
How is MacVim build then?  The info is scarce...


I do build and use MacVim regularly. The GUI version works without any issues.

Regards,
Yegappan

Kuriyama Kazunobu

unread,
Jul 11, 2020, 2:21:23 PM7/11/20
to vim_dev
My understanding is that macOS is a certified Unix and that every Unix user expects that X Windowing System runs there. For that, there's XQuartz there for years, not just because it's been easy for someone having some interest to have it. So, if it's really a Unix, it's quite natural for people to expect that it's at least technically possible to implement a GUI version of a given TUI using Athena or any other X11 GUIs such as Motif, GTK, and Qt. Currently and fortunately, Vim fully fulfills the expectation, and hence I don't think there's any good reason to disable any of the GUIs as long as there's no or little cost to maintain them.

On the other hand, as someone has already pointed out, Carbon has long been deprecated and is now discontinued, the cost to maintain the Carbon GUI seems not to be affordable unless there's someone who has a working Mac machine running more than a decade.

Regards,
Kazunobu

Yegappan Lakshmanan

unread,
Jul 11, 2020, 2:27:51 PM7/11/20
to vim_dev
Hi,

On Sat, Jul 11, 2020 at 11:21 AM Kuriyama Kazunobu <kazunobu...@gmail.com> wrote:
My understanding is that macOS is a certified Unix and that every Unix user expects that X Windowing System runs there.  For that, there's XQuartz there for years, not just because it's been easy for someone having some interest to have it.  So, if it's really a Unix, it's quite natural for people to expect that it's at least technically possible to implement a GUI version of a given TUI using Athena or any other X11 GUIs such as Motif, GTK, and Qt.   Currently and fortunately, Vim fully fulfills the expectation, and hence I don't think there's any good reason to disable any of the GUIs as long as there's no or little cost to maintain them.


Are they any instructions for building a GUI Vim with X11 or Motif or GTK or Qt on
MacOS? If there is, we should update the INSTALLmac.txt file with those instructions.
 
On the other hand, as someone has already pointed out, Carbon has long been deprecated and is now discontinued, the cost to maintain the Carbon GUI seems not to be affordable unless there's someone who has a working Mac machine running more than a decade.


I think we can safely remove the support for building Vim with Carbon on MacOS.
This currently doesn't work and is not tested.

Regards,
Yegappan

Tony Mechelynck

unread,
Jul 11, 2020, 3:11:52 PM7/11/20
to vim_dev
On Sat, Jul 11, 2020 at 8:27 PM Yegappan Lakshmanan <yega...@gmail.com> wrote:
>fourchette (hippologie)
> Hi,
>
> On Sat, Jul 11, 2020 at 11:21 AM Kuriyama Kazunobu <kazunobu...@gmail.com> wrote:
>>
>> My understanding is that macOS is a certified Unix and that every Unix user expects that X Windowing System runs there. For that, there's XQuartz there for years, not just because it's been easy for someone having some interest to have it. So, if it's really a Unix, it's quite natural for people to expect that it's at least technically possible to implement a GUI version of a given TUI using Athena or any other X11 GUIs such as Motif, GTK, and Qt. Currently and fortunately, Vim fully fulfills the expectation, and hence I don't think there's any good reason to disable any of the GUIs as long as there's no or little cost to maintain them.
>>
>
> Are they any instructions for building a GUI Vim with X11 or Motif or GTK or Qt on
> MacOS? If there is, we should update the INSTALLmac.txt file with those instructions.

Are they any different from the instructions (including having X11,
including "development" packages, installed at compile-time and an X11
server running at run-time) for building them on other Unix-like
operating systems?
>
>>
>> On the other hand, as someone has already pointed out, Carbon has long been deprecated and is now discontinued, the cost to maintain the Carbon GUI seems not to be affordable unless there's someone who has a working Mac machine running more than a decade.
>>
>
> I think we can safely remove the support for building Vim with Carbon on MacOS.
> This currently doesn't work and is not tested.
>
> Regards,
> Yegappan

Best regards,
Tony.

Bram Moolenaar

unread,
Jul 11, 2020, 4:20:56 PM7/11/20
to vim...@googlegroups.com, Kuriyama Kazunobu
So MacVim does not use src/gui_mac.c ?

--
hundred-and-one symptoms of being an internet addict:
7. You finally do take that vacation, but only after buying a USB modem
and a laptop.

Yegappan Lakshmanan

unread,
Jul 12, 2020, 12:37:07 AM7/12/20
to vim_dev
Hi Tony,

On Sat, Jul 11, 2020 at 12:11 PM Tony Mechelynck <antoine.m...@gmail.com> wrote:
On Sat, Jul 11, 2020 at 8:27 PM Yegappan Lakshmanan <yega...@gmail.com> wrote:
>fourchette (hippologie)
> Hi,
>
> On Sat, Jul 11, 2020 at 11:21 AM Kuriyama Kazunobu <kazunobu...@gmail.com> wrote:
>>
>> My understanding is that macOS is a certified Unix and that every Unix user expects that X Windowing System runs there.  For that, there's XQuartz there for years, not just because it's been easy for someone having some interest to have it.  So, if it's really a Unix, it's quite natural for people to expect that it's at least technically possible to implement a GUI version of a given TUI using Athena or any other X11 GUIs such as Motif, GTK, and Qt.   Currently and fortunately, Vim fully fulfills the expectation, and hence I don't think there's any good reason to disable any of the GUIs as long as there's no or little cost to maintain them.
>>
>
> Are they any instructions for building a GUI Vim with X11 or Motif or GTK or Qt on
> MacOS? If there is, we should update the INSTALLmac.txt file with those instructions.

Are they any different from the instructions (including having X11,
including "development" packages, installed at compile-time and an X11
server running at run-time) for building them on other Unix-like
operating systems?

I have Xquartz (https://www.xquartz.org/) and Xcode installed in my system.
With this setup, I tried building Vim with Athena support. The build fails in the
balloon eval code.

Note that I am able to successfully build MacVim with native Mac GUI support
on this system.

Regards,
Yegappan

Emir SARI

unread,
Jul 12, 2020, 11:47:37 AM7/12/20
to vim_dev
Looks like no. There is its own implementation: https://github.com/macvim-dev/macvim/tree/master/src/MacVim

11 Temmuz 2020 Cumartesi 23:20:56 UTC+3 tarihinde Bram Moolenaar yazdı:

Yee Cheng Chin

unread,
Aug 12, 2020, 3:46:03 AM8/12/20
to vim...@googlegroups.com
Sorry for chiming in late after gui_mac.c is actually removed (that's how I discovered this thread!), but I'm the current maintainer of MacVim (but not the original author). But yeah MacVim doesn't use gui_mac.c at all and it exists as a downstream fork of Vim in a different repository. Mac GUI apps generally work as an app bundle that only have a single instance running, and so MacVim's GUI code serves as a separate container app that spawns multiple Vim processes (one per window). The code to do all of that are a bunch of Objective C code (in the folder linked to above) and a fair bit of modifications inside Vim source code itself to provide MacVim-specific behaviors using ifdef's. There is a file called gui_macvim.m (https://github.com/macvim-dev/macvim/blob/master/src/MacVim/gui_macvim.m) that serves a similar function as gui_mac.c as the entry point of GUI code in MacVim.

Some of the MacVim modifications in Vim are sort of just general Mac improvements and maybe could be ported over to Vim itself, but I haven't done a scrub of the Vim-MacVim diff to see if that's the case. Some others are very MacVim-specific (e.g. help page for MacVim, or support for mapping Cmd keys and touchpad gestures).

But long story short, yes, gui_mac.c is a totally separate thing from MacVim. I think I tried to build that legacy Mac GUI before with varying success and can't remember how far I got, but yes it didn't work well at all. Removing it actually probably makes merging from upstream easier for us because there are fewer potential places to have merge conflicts.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/ecdb4f6e-8f9b-4369-b4b9-531640ce7445o%40googlegroups.com.

Bram Moolenaar

unread,
Aug 12, 2020, 8:22:32 AM8/12/20
to vim...@googlegroups.com, Yee Cheng Chin

Yee Cheng Chin wrote:

> Sorry for chiming in late after gui_mac.c is actually removed (that's how I
> discovered this thread!), but I'm the current maintainer of MacVim (but not
> the original author). But yeah MacVim doesn't use gui_mac.c at all and it
> exists as a downstream fork of Vim in a different repository. Mac GUI apps
> generally work as an app bundle that only have a single instance running,
> and so MacVim's GUI code serves as a separate container app that spawns
> multiple Vim processes (one per window). The code to do all of that are a
> bunch of Objective C code (in the folder linked to above) and a fair bit of
> modifications inside Vim source code itself to provide MacVim-specific
> behaviors using ifdef's. There is a file called gui_macvim.m (
> https://github.com/macvim-dev/macvim/blob/master/src/MacVim/gui_macvim.m)
> that serves a similar function as gui_mac.c as the entry point of GUI code
> in MacVim.
>
> Some of the MacVim modifications in Vim are sort of just general Mac
> improvements and maybe could be ported over to Vim itself, but I haven't
> done a scrub of the Vim-MacVim diff to see if that's the case. Some others
> are very MacVim-specific (e.g. help page for MacVim, or support for mapping
> Cmd keys and touchpad gestures).
>
> But long story short, yes, gui_mac.c is a totally separate thing from
> MacVim. I think I tried to build that legacy Mac GUI before with varying
> success and can't remember how far I got, but yes it didn't work well at
> all. Removing it actually probably makes merging from upstream easier for
> us because there are fewer potential places to have merge conflicts.

Removing gui_mac.c was easy, but there are several #ifdefs that are
related, and not always clear what they were for. If any of this was
actually used by MacVim, please let us know what should be put back.

I can actually probably delete some more dead code. Perhaps you, or
someone else with a Mac and development environment, can try making
changes and check the Terminal version still fully works.


--
If Microsoft would build a car...
... The airbag system would ask "are you SURE?" before deploying.

Yee Cheng Chin

unread,
Aug 13, 2020, 2:12:30 AM8/13/20
to Bram Moolenaar, vim...@googlegroups.com
Alright, filed https://github.com/vim/vim/pull/6703 to do some clean up on the Mac GUI code/docs. It mostly handles the obvious stale comments/code that are now confusing as the Mac GUI is now removed.

Also had some small questions (it's on the pull request) about how we should handle stale deprecated options like 'macatsui'.

def...@gmail.com

unread,
Apr 12, 2025, 7:34:59 PMApr 12
to vim_dev
Platform Mac OSX 10.6.8 - Snow Leopard
Tools: XCode with the gnu tools and libraries off the snow leopard install DVD.
gcc version 4.2.1

I only used the supplied libraries on the dvd.  However, I suppose one could download the gtk2 source code and build gtk2 from
source and use the gtk2 option for the gui. Which probably would produce a more pleasing gui than the clunky athena.
It seems the tools supplied by the DVD are sufficient as a starting point to build your own support libraries which you
can use with vim: lua, etc.

If I use --enable-gui=athena in the configure script, a gui version of athena is built with icons, menus and all working.

The --enable-gui=carbon also works. And I find a Vim executable in the src directory, not vim but Vim. It runs also. But I don't see any
menus, icons, etc. It looks and works like a regular console version of vim. These were built on a macbook pro 15 2006 glossy core duo
with the 32-bit Yonah Core Duo Processor.

I'm used to building vim on an M68k mac running linux. So, working on an intel based mac seems to be much easier and quicker. I was probably building vim before
most of you guys were born.
Reply all
Reply to author
Forward
0 new messages