Adding filetypes to Spotlight
From Mac Guides
This tip requires
By default, Spotlight doesn't index every file on your hard drive, and it's not very user friendly to add additional types. This guide details how to add files to the spotlight index.
Index Third-Party Filetypes
Some Noteable Spotlight Plugins
For a complete list, see Apple's Spotlight download page
Index PHP files
This section illustrates, by example, how to add PHP files to your spotlight index.
- Install the developer tools
- In the finder, Go to "/Library/Spotlight" (command-shift-G)
- Control-click on SourceCode.mdimporter (which is there if you've installed the developer tools]] and show package contents
- Open Info.plist in (preferably) Property List Editor. Otherwise, you'll be editing XML in a text editor
- Add the following to Root->CFBundleDocumentTypes->0>LSItemsContentTypes
- Open Terminal and type
mdimport -r /Library/Spotlight/SourceCode.mdimporter
- After a while, when Spotlight finishes reindexing, you'll be able to search inside PHP files.
Index c and c++ header files
- Open Terminal
- Type this: