Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enable Spotlight indexing of Markdown in El Capitan without disabling SIP
diff -ru RichText.mdimporter/Contents/Info.plist Markdown.mdimporter/Contents/Info.plist
--- RichText.mdimporter/Contents/Info.plist 2015-11-23 16:14:12.000000000 +0200
+++ Markdown.mdimporter/Contents/Info.plist 2015-11-23 16:10:03.000000000 +0200
@@ -13,15 +13,7 @@
- <string>public.rtf</string>
- <string>public.html</string>
- <string>public.xml</string>
- <string>public.plain-text</string>
- <string></string>
- <string></string>
- <string></string>
- <string>org.oasis-open.opendocument.text</string>
- <string>org.openxmlformats.wordprocessingml.document</string>
+ <string>net.daringfireball.markdown</string>
@@ -30,11 +22,11 @@
<string>1.0, Copyright (c) 2004-2010 Apple Inc.</string>
- <string></string>
+ <string></string>
- <string>Rich Text Sniffer</string>
+ <string>Markdown Sniffer</string>

This comment has been minimized.

Copy link
Owner Author

commented Nov 23, 2015

  • Create a copy of the system RichText.mdimporter
  • patch to set it up to only index markdown
  • rename it to Markdown.mdimporter
  • Copy into /Library/Spotlight
  • Tell spotlight to start indexing with it
cp -r /System/Library/Spotlight/RichText.mdimporter .
patch -p2 RichText.mdimporter/Contents/Info.plist < Markdown.mdimporter.patch
mv RichText.mdimporter Markdown.mdimporter
sudo cp -R Markdown.mdimporter /Library/Spotlight
mdimport -r /Library/Spotlight/Markdown.mdimporter

This comment has been minimized.

Copy link

commented Dec 2, 2015

You need to rename the patch file to "Markdown.mdimporter.patch". Notice the missing k.


This comment has been minimized.

Copy link

commented Sep 21, 2017

cool :)

How to rebuild the Spotlight index on your Mac:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.