How to change the default text editing app in Quick Look? I want to customize which app is used to open all unknown plain text files from Quick Look. For example, for extension-less VERSION file, Quick Look shows Open with TextEdit:



I'd like to make VSCode the default editor for unknown file types.

BTW, to even achieve a textual preview of the VERSION file, I had to install https://github.com/whomwah/qlstephen.



UPDATE &amp; solution: This question is indeed closely related to Replace Text Edit as the default text editor, the problem was that neither of the answers mentioned public.data which was necessary for the VERSION file in this example. (Without 'public.data', VSCode was offered for .txt files but not for extension-less files.)

I've updated this answer to that question to include info about 'public.data', in which case this question is really a duplicate of Replace Text Edit as the default text editor.
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