How to change the default text editing app in Quick Look? [duplicate]

Extension-less files are tricky ones for OS to figure out if it is an executable or a text file. I have two README files, one of which is unix executable for some reason and I get a warning if I open it. Another is text file but still recognised as public.data as opposed to public.plain-text.

mdls path/to/file

gives you its kMDItemContentType. public.data files' QuickLook are generated by

/Users/me/Library/QuickLook/QLStephen.qlgenerator

Run qlmanage -m to get a list.

Unless you can find a QuickLook generator by VSCode, which can preview public.data files, you don't have much to do.

I haven't used it, but this seems promising: https://github.com/whomwah/qlstephen

OP's response

This worked: duti -s com.microsoft.VSCode public.data all

  • Replace Text Edit as the default text editor