When using Quick Look on a code file — .swift
or .cpp
, etc. — the font used to render the text seems to be Menlo. I was wondering if this is customizable. Can I manually set it to any font I want, such as SF Mono or Source Code Pro?
1 Answer
Removed the erroneous suggestion that it was Xcode font settings that provided this functionality.
You can find out which application is responsible for displaying source code in QuickLook by using this command in the terminal:
qlmanage -m plugins | grep -i "public.source-code"
If nothing shows up you don't have an application that provides this functionality.
In that case you can try this quicklook plugin https://github.com/anthonygelibert/QLColorCode.
-
Indeed nothing showed up, does this means QuickLook will fall back to system default font for codes?– jackxujhNov 4, 2017 at 11:38
-
That's my best guess. Menlo is the default non-proportional font, SF Mono is as far as I know only available in Xcode and Terminal as a selectable option. The QLColorCode plugin gives you the option to set the font to your of your choosing.– PeterVPNov 5, 2017 at 9:54
qlmanage -l
and got a long list of generators. How do I find which generator is used to generate previews for which kind of files?grep -i code
to getpublic.source-code
. If you change frequently and the/System
-QL doesn't pick it up instantly:qlmanage -h
revealsqlmanage -r
to reset QLdaemon. Find here the list of precedences.public.source-code -> /Applications/TextMate.app/Contents/Library/QuickLook/TextMateQL.qlgenerator (1.0)