默認(rèn) Spotlight 不檢索 Markdown觉既,只需三步即可支持羊异。
一:關(guān)閉 Mac 的系統(tǒng)文件保護
進入恢復(fù)模式,在 Terminal 里輸入 csrutil disable
重啟。
二:讓 Spotlight 檢索 Markdown
編輯 /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist
桥胞,在 LSItemContentTypes
字段中添加
<string>net.daringfireball.markdown</string>
三:重載配置并重建檢索
在 Terminal 里執(zhí)行
$ mdimport -r /System/Library/Spotlight/RichText.mdimporter
$ sudo mdutil -E /
等待 10 分鐘,讓 Spotlight 建立好索引考婴,就支持 Markdown 了贩虾。
成功后,最好再進入恢復(fù)模式沥阱,使用 csrutil disable
打開系統(tǒng)文件保護缎罢。
設(shè)置Spotlight檢索類別
檢索類別:文稿(檢索Markdown必須勾選這個),及你需要的其他
檢索位置:除了你需要的都排除,最方便的操作方法是:Finder 打開 / 然后拖入你不想檢索的位置
然后執(zhí)行
$ sudo mdutil -E /
讓 Spotlight 建立好索引策精,就能檢索到 Markdown 了舰始。