How can I install MacVim on OS X?

165,770

Solution 1

  • Step 1. Install homebrew from here: http://brew.sh
  • Step 1.1. Run export PATH=/usr/local/bin:$PATH
  • Step 2. Run brew update
  • Step 3. Run brew install vim && brew install macvim
  • Step 4. Run brew link macvim

You now have the latest versions of vim and macvim managed by brew. Run brew update && brew upgrade every once in a while to upgrade them.

This includes the installation of the CLI mvim and the mac application (which both point to the same thing).

I use this setup and it works like a charm. Brew even takes care of installing vim with the preferable options.

Solution 2

There is also a new option now in http://vimr.org/, which looks quite promising.

Solution 3

  1. Download the latest build from https://github.com/macvim-dev/macvim/releases

  2. Expand the archive.

  3. Put MacVim.app into /Applications/.

Done.

Solution 4

That Macvim is obsolete. Use https://github.com/macvim-dev/macvim instead

See the FAQ (https://github.com/b4winckler/macvim/wiki/FAQ#how-can-i-open-files-from-terminal) for how to install the mvim script for launching from the command line

Share:
165,770
hbaromega
Author by

hbaromega

Updated on November 04, 2020

Comments

  • hbaromega
    hbaromega over 3 years

    I am using OS X 10.9.1 (Mavericks).

    What are the systematic steps to install to Gvim or MacVim in Mac OS? If you write the steps using 1, 2, 3, ..., it would be easy to follow.

    I must confess that I failed to understand all the instructions provided on MacVim page. Other google-searched webpages do not clarify. E.g.

    What is $VIMRUNTIME ? What version of vim should I install for my OS?

    Now somehow I have installed MacVim in my system (Not systematically I believe). I can see that I have a folder /Applications/gvim.app/MacVim.app/.

    Now when I open a text file from MacVim, which was already written using vi-editor, MacVim does not recognize it. Also vi does not recognize whatever is written in MacVim!

    How can I resolve this?

  • krystah
    krystah over 10 years
    Upping this. The brew-ed MacVim is updated much more frequently than the one from the link Peter posted. Both work though.
  • Peter Gibson
    Peter Gibson over 10 years
    Nice, does brew install binary packages or compile from source?
  • reem
    reem over 10 years
    Compiles it from source. You can take a look at github.com/Homebrew/homebrew/blob/master/Library/Formula/… to see the actual ruby script that brew uses to install it.
  • reem
    reem over 10 years
    You can also run brew edit formula to see/edit the source of the script that installs that formula in your editor.
  • Kara Brightwell
    Kara Brightwell over 9 years
    Not sure when this was added but linking the app now requires running brew linkapps.
  • Sam
    Sam about 9 years
    Hi there, I followed your list of steps and installed homebrew, but when I got to step 3, it failed to download cscope and then the installation failed. Do you know what to do now?
  • trazillian
    trazillian about 9 years
    Expanding on reem's answer: if you have trouble with brew you can run the command brew doctor and see if your brew has anything it needs to run correctly.
  • Ahmed Fasih
    Ahmed Fasih almost 9 years
    Some plugins don't play nice with brewed vim, alas: github.com/Valloric/YouCompleteMe recommends building macvim from scratch.
  • Eric Angell
    Eric Angell over 8 years
    I didn't already have the full Xcode installed, so it went part way and balked at that. Installed Xcode via App Store and reran, and it got into a no-win situation where running brew without sudo got "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." and running it with sudo got "You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk." Fixed by running sudo xcodebuild -license
  • DonnaLea
    DonnaLea over 8 years
    Also, to make this work with Spotlight, I found that right clicking the homebrew MacVim application (/usr/local/Cellar/macvim/7.4-81/MacVim) > "Make Alias" and moving that into /Applications Spotlight will then pick it up. Don't know why the brew linakapps alias doesn't get picked up by Spotlight. (this is as of brew 0.9.5 on OS X El Capitan)
  • aug
    aug about 8 years
    I also ran into the Xcode issue and ended up getting it to work by doing brew cask install macvim --override-system-vim
  • Wildcard
    Wildcard over 7 years
    "Expand it"? I'm looking, but the only way I see to get the app built as a .app from that link is to compile it (requiring the 4+ GB download of Xcode). Is this answer still valid?
  • romainl
    romainl over 7 years
    Of course it's still valid. GitHub is not exactly a model in terms of UX so I forgive you for missing the "Releases" link.
  • Wildcard
    Wildcard over 7 years
    Ha, thanks. Of course I see this after I finish downloading and compiling manually....
  • denis
    denis over 7 years
    MacVim.dmg installs to /Applications ok, but without mvim -- that's on github (clone or .zip).
  • alexventuraio
    alexventuraio over 7 years
    To set the mvim shell script just copy the mvim file from the DMG and paste to your Desktop, then open a Terminal and type cp ~/Desktop/mvim /usr/local/bin and restart the terminal. That's it! :D Now open folder or files with mvim . or mvim file.txt
  • AbePralle
    AbePralle over 5 years
    After installing the DMG there is an mvim script at /Applications/MacVim.app/Contents/bin/mvim. My preference is to create a /usr/local/bin/mvim launcher with #!/bin/sh / exec /Applications/MacVim.app/Contents/bin/mvim "$@"
  • zerocog
    zerocog over 5 years
    After dmg install, to launch from command line with args: set add path to to the bin of the app. For MacVim, I did the following. export PATH=/Applications/MacVim.app/Contents/bin:$PATH An alias, is another option I tried. alias mvim='/Applications/MacVim.app/Contents/bin/mvim' alias gvim=mvim