V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nthin0
V2EX  ›  macOS

macos 上求一个支持 yaml 文件的 quicklook 插件

  •  
  •   nthin0 · Feb 5, 2020 · 2610 views
    This topic created in 2277 days ago, the information mentioned may be changed or developed.

    macos 上求一个支持 yaml 文件的 quicklook 插件,提前谢谢大佬们了

    Supplement 1  ·  Feb 6, 2020
    已解决,跟楼下提供的方式略有区别:
    打开~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist
    找到 CFBundleDocumentTypes - LSItemContentTypes,增加 public.yaml
    执行 qlmanage -r 就可以了
    谢谢 @jorneyr 大佬
    3 replies    2020-02-05 20:29:04 +08:00
    jorneyr
        1
    jorneyr  
       Feb 5, 2020
    使用 QLColorCode 预览指定格式的文件,如 .sh, .bat, .properties:
    1. 安装 QLColorCode: `brew cask install qlcolorcode`
    2. 获取 UTI: `mdls -name kMDItemContentType application.properties`,输出:
    kMDItemContentType = "dyn.ah62d4rv4ge81a6xtsbw1e7dmqz3u"
    3. 打开 ~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist,找到节点 Document Content Type UTIs,
    把上面得到的 dyn.ah62d4rv4ge81a6xtsbw1e7dmqz3u 加入到这个节点下,保存
    4. 执行 `qlmanage -r`,然后就可以使用 QLColorCode 预览 .properties 的文件了

    预览其他格式参考上面的步骤即可。
    nthin0
        2
    nthin0  
    OP
       Feb 5, 2020 via iPhone
    @jorneyr plist 里没有找到这个节点。。
    jorneyr
        3
    jorneyr  
       Feb 5, 2020
    Document types > Item 0 > Document Content Type UTIs
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   812 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:54 · PVG 04:54 · LAX 13:54 · JFK 16:54
    ♥ Do have faith in what you're doing.