Adding filetypes to Spotlight
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
A growing list of applications have Spotlight plugins available for download. These plugings usually take the form of a package and install all the necessary files (in /Library/Spotlight).
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.
- Add the following to Root->CFBundleDocumentTypes->0>LSItemsContentTypes
- Open Terminal and type
- After a while, when Spotlight finishes reindexing, you’ll be able to search inside PHP files.
public.php-script
mdimport -r /Library/Spotlight/SourceCode.mdimporter
Index c and c++ header files
- Open Terminal
- Type this:
mdimport -f /usr/include mdimport -f /usr/local/include mdimport -f /System/Library/Frameworks















































