9


I have Mac Pro, with OS X 10.9.4 (can't upgrade to Yosemite yet), and I'm trying to build vim7.4 with gui-support, or get any kind of gui-support. My current vim is version 7.3, I'm guessing, that's the default vim that ships with macs. I have the Terminal.app and iTerm2.app, my vim rc has the default

set term=xterm-256colors

or what have you.

What I have so far:

macvim

The colors look great, basically it's the same setup I had on my ubuntu system, but it's really annoying that it opens a new window. Is there a way to get it to open within my terminal? (not launch it from the terminal, open inside of it)

As I've said I have the regular vim7.3 And while I can use color-schemes, they look like garbage compared to my ubuntu system. I suppose this must be due to gui-support option? I tried, CSApprox but that gives me a weird error.

So I decided to simply build vim 7.4 and enable gui support, but I get random errors.
My basic config make looks like:

./configure --enable-gui=yes
make

At which point it complains about missing header file etc. , I figured this should not be that hard.

Any tips?

The basics of what I'm trying to do is:

Have a vim version installed with gui-support, or a work-around where my colors are all screwed up.

Thanks!

janjust
  • 796
  • 2
  • 7
  • 21

2 Answers2

11

Building Vim on Mac OS X is a waste of time.

Step 1: Download the appropriate MacVim build from here.

Step 2: Put MacVim.app into the /Applications/ directory.

Step 3: Put the bundled mvim script somewhere in your PATH.

Done.

To run MacVim in your shell:

$ mvim -v filename

To run MacVim from your shell:

$ mvim filename
9999years
  • 1,561
  • 13
  • 14
romainl
  • 186,200
  • 21
  • 280
  • 313
  • 4
    @janjust I might also add that if you are using the excellent [Homebrew](http://brew.sh/) `brew` application, you can install MacVIM using the command `brew install macvim --with-lua --with-luajit`. This has the advantage that you can simply run `brew upgrade macvim` to get the latest version. – shaond Dec 07 '14 at 01:39
  • @shaond Are the Lua flags necessary for any of the built in features, or are they just for custom scripts/plugins? – Nick McCurdy Sep 03 '16 at 23:13
  • 1
    @NicolasMcCurdy, `+lua` is only used by a handful of plugins. – romainl Sep 04 '16 at 07:58
  • Only problem with MacVim is that it's behind the times. As of this date, McVim is V8.1.577, whereas Vim is V8.1.682. And you cannot have both Vim and MacVim installed (without name changes) because they both install the same binaries. – JESii Jan 03 '19 at 14:11
  • @JESii lagging by a hundred patches means MacVim is stable and yes, you can have MacVim installed alongside any other Vim. – romainl Jan 08 '19 at 09:45
  • ‘Stability’ issues with brew vim have been next to zero in all my years, so my preference is for patches. Some delay is fine, IMO, but there’s a limit for me. And even with the suggestions below, I’ve not been able to get the GUI option to stick. – JESii Jan 08 '19 at 23:43
6

Building Vim with GUI on macOS using Homebrew:

  1. brew edit vim.
  2. Add a new line with option for GUI:

    option "enable-gui", "Enable GUI mode"
    
  3. Change from no to yes in the following line:

    opts << "--enable-gui=no"
    
  4. Install or re-install vim:

    brew reinstall vim --enable-gui
    

Troubleshooting:

  • If you've errors related to Python 3, see: vim's GH-2754.
  • Checkout new Homebrew PR at GH-25785 with above patch.
kenorb
  • 155,785
  • 88
  • 678
  • 743