whomwah / qlstephen

A QuickLook plugin that lets you view plain text files without a file extension
https://github.com/whomwah/qlstephen
MIT License
2.76k stars 161 forks source link

Doesn't work for YAML files *.yml #110

Open ghost opened 3 years ago

visnetje commented 3 years ago

Work-around inspired by https://github.com/whomwah/qlstephen/issues/87#issuecomment-831399689 :

Edit the Info.plist inside the QLStephen.qlgenerator in your favorite text editor and look for the following block:

            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>

I managed to get both CSS and YAML to work by adding their UTI types as follows:

            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
                <string>public.css</string>
                <string>public.yaml</string>
            </array>

Then I reloaded the QuickLook cache with qlmanage -r and qlmanage -r cache (in the Terminal app).

If adding the entry to Info.plist didn't seem to work, double check the UTI type for YAML files with the following command (in the Terminal app):

$ mdls -name kMDItemContentType ~/path/file.yml
kMDItemContentType = "public.yaml"

Where ~/path/file.yml is the path to the YAML file, and public.yaml is the part of my specific output that I used.

benjaminapetersen commented 2 years ago

+1 This would be great as an out of the box support. With so much software doing config via YAML (.yaml, .yml) this was actually the primary support I was looking for.

Adding .css also and honestly just about any developer related file extension seems a good idea.