15

I would like to use "space" to preview *.yml files directly out of the finder on Mac OS X.

I think I have to tell finder to launch the text file quick view handler for files with that type and this has something to do with universal type identifiers (UTI.)

But that's as far as I was able to get.

Can anyone give me the magic formula? Thanks!!

4 Answers 4

2

I use Ciarán Walsh’s TextMate in QuickLook plugin.

This is a TextMate plug-in and a QuickLook generator which renders QuickLook previews (for certain filetypes) using the TextMate syntax highlighter. Currently it’s configured to highlight Perl, PHP, Ruby, Shell, C headers and Obj-C(++). Note: this effectively sets up TextMate as a server for the syntax highlighting, so it won’t work unless TM is running (QuickLook will just fall back to the standard preview if it’s not).

Here is a convenience link to download the plugin and you can read more about it on Ciarán's web page.

This is what it looks like when I QuickLook a .yml file:

.yml QuickLook

12

I've had great luck with the free QLStephen plugin for Quick Look. It displays lots of other plaintext formats.
Probably worth a shot to see if it will work with YAML files.

You can get it here.

5
  • 1
    This should be the selected answer. Also, for installation instructions: github.com/whomwah/qlstephen
    – Volte
    Sep 8, 2015 at 16:02
  • Worked again in 2018! Cool feature
    – Dolev
    Mar 22, 2018 at 9:30
  • 1
    Did not work in 2020. Do I have to put a special setting?
    – gr4nt3d
    Mar 19, 2020 at 0:22
  • 1
    Yes, read the github page where installation is explained. On Catalina the com.apple.quarantine extended attribute must be removed.
    – Reven
    May 8, 2020 at 7:44
  • 1
    Works for me in 2021, but crucially you have to add public.yml to LSItemContentTypes in ~/Library/QuickLook/QLStephen.qlgenerator/Contents/Info.plist as described in another answer on this page
    – Alan H.
    Feb 17, 2021 at 5:51
9

You can use the QLStephen plugin as mentioned but you will need to edit it as described in the project's issue tracker: https://github.com/whomwah/qlstephen/issues/23#issuecomment-21769063

Basically:

  1. Open the ~/Library/QuickLook/QLStephen.qlgenerator/Contents/Info.plist file in a text editor
  2. Add the UTI public.yaml to the key LSItemContentTypes
  3. Run qlmanage -r to reload the service
1
0

Most of these didn't work for me.

This did: https://github.com/sbarex/SourceCodeSyntaxHighlight

Really excellent, worked immediately, lots of options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .