I've installed macvim via homebrew. This is working fine.

But when it commes to choose a default application for a new file type I cannot see MacVim. How can I set MacVim as the default application for a file type when it has been installed with homebrew?

Note: The question is not about how to select a default application in Finder, the question is how to set an application as default which is not listed in /Applications and there fore not shown by the Finder as a possible default application.


5 Answers 5


I had the same issue. I moved MacVim.app to /Applications and then symlinked it into the Homebrew cellar directory.

mv /usr/local/Cellar/macvim/7.3-65/MacVim.app /Applications/  
ln -s /Applications/MacVim.app /usr/local/Cellar/macvim/7.3-65/
  • 1
    Doesn't this need to be repeated each time MacVim is upgraded?
    – Eric Hu
    Commented Mar 7, 2013 at 9:51
  • 2
    Worked for me. But mine was 7.3-66 which highlights @EricHu's concern... It suggests there is a better solution
    – matt burns
    Commented Nov 11, 2013 at 15:55
  • 3
    I made easier without moving - only link: ln -s /usr/local/Cellar/macvim/8.0-130/MacVim.app/ /Applications/MacVim.app - but yes looks like link must be upgraded after changing the version of installed MacVim - because the path to the source folder will be changed. Commented May 30, 2017 at 6:58

Correction: This is no longer the case, see https://github.com/Homebrew/homebrew/issues/8699

Note that brew linkapps puts links in ~/Applications, not /Applications. I had to follow the symlink (select your home directory from Favorites, select the Applications icon in the main pane, and click Open), then pull down the path list-box near the top of the dialog box (or hit Command+Up) to go one level back up the physical path. Then you can see the icon for the actual .app folder.

  • It actually put the link in /Applications for me. The behavior must have changed. Commented Oct 10, 2015 at 2:05

You can set the default app from Finder.

  1. Select the file (e.g. foo.rb) and then choose 'Get Info' (command I, or File | Get Info).
  2. Open the 'Open with' section.
  3. Select your default app and then press 'Change All...'.
  • 4
    That's just an other way of getting the same problem. Since MacVim has been installed using homebrew it's never listed in the list of applications. This is also true if I choose to see the atlernative list of applications.
    – BetaRide
    Commented Aug 22, 2012 at 5:47

Try running brew linkapps. That's how you're supposed to do it, but it never works for me; if the same is true for you, do ln -s /usr/local/Cellar/macvim/7.3-64/MacVim.app /Applications (substituting the actual location of the app, if it differs on your system).

Homebrew should have told you that when you installed MacVim.

  • 1
    Thanks for the answer. brew links did not help. I can see MacVim in the Launchpad and can open a file in finder now, but it's still not listed in the list of applications when I want it to set as the default application for .txt (or other file types). Adding the link doesn't work either. MacVim does get listed now, but when I choose MacVim finder grays out the open button. Somme how it's not sufficient to just sym link the MacVim.app.
    – BetaRide
    Commented Aug 25, 2012 at 6:49
  • It works for me! The open button works too. My brew version is 0.9.5 Commented Oct 6, 2014 at 10:37
  • 2
    brew linkapps is no longer supported.
    – zhon
    Commented Sep 4, 2019 at 7:41

I had a similar problem, however I only wanted to use third-party MacPorts (a Homebrew alternative) applications where there was no native Apple version on the system.

To stop the MacPorts applications from being used in preference over native APPLE apps, I modified my $PATH: vi ~/.profile

# Original PATH which favoured MacPorts Commented-out
#export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

# Modified path prepending "/usr/bin" in front ensuring native apps favoured
export PATH="/usr/bin:/opt/local/bin:/opt/local/sbin:$PATH"

Using this PATH configuration, only if a native Apple application is not found will the MacPorts path be consulted.

BEFORE PATH Modified: Default VIM is MacPorts

Terrences-MacBook-Pro:pi-ap terrence$ which vim

AFTER PATH Modified: Default VIM is Apple's version

Terrences-MacBook-Pro:pi-ap terrence$ which vim

If you want the third-party Homebrew apps to be default where there are alternatives in other paths, just ensure the Homebrew path is precedes them in your PATH.

Worked for my use-case, but might not be right for alternate use-cases.

Remember to logout after changing your .profile for the new PATH changes to be effective-

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .