I used brew to install MacVim and it put it in /usr/local/Cellar/macvim/7.3-61/MacVim.app

I would like to be able to go to spotlight and type MacVim to launch the app. I tried creating a symlink in the Applications directory to /usr/local/Cellar/macvim/7.3-61/MacVim.app. But that doesn't seem to show up in Spotlight. I set the executable bits on the symlink. open MacVim.app from the command line works. How can I get MacVim to show up in Spotlight search?

Spotlight doesen't look inside hidden folders and apparently doesen't work for aliases either. Do you use spotlight to launch apps? If so I must recomend alfredapp.com. I use it and its great. Faster than spotlight!
–
kevin9794Aug 31 '11 at 2:25

Thanks. I installed alfred and added the MacVim folder to the search scope. Im in much better shape.
–
m_sharpAug 31 '11 at 5:00

So it seems Spotlight does index aliases! Haha sweet. Anyhow I'm glad you liked Alfred and its great you figured how to add things to spotlight too.
–
kevin9794Aug 31 '11 at 23:43

3

Welcome to Ask Different! If you found a solution, please post it as an answer so it's easier for others with the same problem to see what helped. Please take a look at the FAQs for more info. Thanks.
–
Nathan GreensteinNov 11 '11 at 23:10

5 Answers
5

In the Finder, press CommandShiftG for Go to the Folder. Type /usr/local/Cellar/macvim/7.3-61/ and press return. Select the file (actually a folder) MacVim.app Press CommandL for Make Alias. Depending on permissions, you may be prompted for an administrator password here.

Press CommandN to create a New Finder Window.
Press CommandShiftA to go to the Applications folder in that window.

Drag the newly created alias from the window in which it was created to the window containing the Applications folder. Rename the alias so it no longer ends in " alias".

I followed your steps and MacVim shows up in spotlight. However when trying to launch MacVim from spotlight, I get an error message "Item MacVim is used by OS X and can't be opened".
–
m_sharpDec 12 '11 at 5:32

Hmmm. How do you ordinarily launch MacVim when not using Spotlight? Do you get an error message then?
–
Daniel♦Dec 12 '11 at 6:26

Maybe spotlight can't launch it because it doesn't have the permissions to access /usr/local/ or something.
–
styfleJan 12 '12 at 4:05

I got this to work by first changing the permissions on /usr/local/Cellar with 'sudo chflags nohidden /usr/local/Cellar' (I actually did this for /usr /usr/local and /usr/local/Cellar). Then I used Finder to create an alias for MacVim (the one in Cellar). Then I moved the alias to my Applications folder. Spotlight now finds MacVim (look at the bottom of its list until you open it once).
–
ChrisOct 18 '14 at 17:32

I also needed to do additional permission changes, by default, it appears the symlink was created without any execute permissions at all, adding those made the symlink appear in spotlight. Oddly enough, aliases I created and then renamed to something that didn't include the word "alias" at the end also weren't picked up by spotlight. Putting "alias" back at the end of the symlink name fixed it-
–
chrismarxMar 16 at 14:34

If you're going to do it this way, just create an Automator app to run the script.
–
SlomojoOct 25 '14 at 14:11

Yes @Slomojo, that proved to be the easiest approach. I created a shellscript that starts the App (in my case libreoffice) and put it in /usr/bin. Then I used automator to just invoke the script and saved the Automator created App in my Applications folder with the name I wanted to use in Spotlight. Absurd.
–
atrioomJan 22 at 12:42

To keep things nice and scriptable, you can use osascript to run a little AppleScript and create your alias automatically.

osascript <<END
set macvim to POSIX file "/usr/local/Cellar/macvim/7.3-61/MacVim.app"
set applications_folder to POSIX file "/Applications"
tell application "Finder"
make alias file to macvim at applications_folder
end tell
END