2

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?

  • Is XCode actually setup as the default application for the filetypes you want to QuickLook? – LangLangC Nov 2 '17 at 12:17
  • Any other editors on the system with QuickLook plugins? Check with qlmanage – LangLangC Nov 2 '17 at 12:49
  • @LangLangC I used 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? – jackxujh Nov 2 '17 at 12:56
  • The list does just that. On my system TextMate claims the QL for these files; add grep -i code to get public.source-code. If you change frequently and the /System-QL doesn't pick it up instantly: qlmanage -h reveals qlmanage -r to reset QLdaemon. Find here the list of precedences. – LangLangC Nov 2 '17 at 13:18
  • TextMate is indeed responsible for the QuickLook preview on my Mac. public.source-code -> /Applications/TextMate.app/Contents/Library/QuickLook/TextMateQL.qlgenerator (1.0) – PeterVP Nov 2 '17 at 18:43
0

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? – jackxujh Nov 4 '17 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. – PeterVP Nov 5 '17 at 9:54

You must log in to answer this question.

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