home > mac > SpotlightForSourceCode.html

Saturday, January 23rd, 2010

Index Source Code with Spotlight

I was frustrated that Spotlight wasn’t indexing any of my source code. What’s the point of Great, instant, system-wide search that doesn’t look in files I care about most? What’s going on?

Thanks to the article Terminal commands for improving Spotlight on Mac OS X Tips (which, by the way is a nice tips site I never knew about) for showing me the way.

The method I used was to edit the info.plist file in RichText.mdimporter (found in /System/Library/Spotlight/), adding <string>public.python-script</string>. Then, I told Spotlight to re-index the RichText file format via:

mdimport -r /System/Library/Spotlight/RichText.mdimporter

/mac   〆   permalink