我通常使用.markdown或.md扩展名来降价文档.不幸的是,聚光灯拒绝索引它们,除非它们具有.txt文件扩展名.
我已经看到了一个可能的解决方案,涉及在textmate博客上编辑Info.plist文件.有没有更好的办法?
更新:我刚刚发现了用于Markdown文件的QuickLook生成器,它增加了聚光灯支持和漂亮的HTML quicklook预览.这是一种享受!
通过创建系统RichText.mdimporter的副本,修改其Info.plist并将其保存在/ Library / Spotlight中,可以在不禁用SIP的情况下执行此操作。
cp -r /System/Library/Spotlight/RichText.mdimporter . patch -p2 RichText.mdimporter/Contents/Info.plist < Markdown.patch mv RichText.mdimporter Markdown.mdimporter sudo cp -R Markdown.mdimporter /Library/Spotlight mdimport -r /Library/Spotlight/Markdown.mdimporter
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 @@MDImporter LSItemContentTypes - @@ -30,11 +22,11 @@public.rtf -public.html -public.xml -public.plain-text -com.apple.traditional-mac-plain-text -com.apple.rtfd -com.apple.webarchive -org.oasis-open.opendocument.text -org.openxmlformats.wordprocessingml.document +net.daringfireball.markdown CFBundleGetInfoString 1.0, Copyright (c) 2004-2010 Apple Inc. CFBundleIdentifier -com.apple.MDImporter.RichText +com.apple.MDImporter.Markdown CFBundleInfoDictionaryVersion 6.0 CFBundleName -Rich Text Sniffer +Markdown Sniffer CFBundleShortVersionString 6.9 CFBundleSupportedPlatforms