1
  • macOS 13.6 Ventura
  • Mac Mini M1

Can someone remind me how to get QuickLook to display .mojo files, or any unknown file to display its contents. Some of my code source files display with code highlighting and everything, but .mojo files do not even display in plain text. There's nothing special about .mojo files; they're just plain text files. Indeed, I've already got them configured to open in Cursor editor when double-clicked. It's just [space] that doesn't work.

bmike
  • 235,889
  • Hi! Spotlight uses file types and I’m not familiar with that extension. Could you use the command line tool mdls to show us the file type(s) of a representative file? KMDItemKind and kMDItemContentType & kMDItemContentTypeTree are most relevant for quick look plug in to render a preview within finder. https://i.stack.imgur.com/OuA9p.jpg open terminal app and type mdls then drag in one or more of the mojo files and drop on the terminal window and press return – bmike Dec 02 '23 at 17:21
  • Thanks for the reply @bmike ask.different puts a limit on the length of replies, it seems, but these are the two sections you mentioned...

    kMDItemContentType = "dyn.ah62d4rv4ge80455nr6" kMDItemContentTypeTree = ( "public.item", "dyn.ah62d4rv4ge80455nr6", "public.data" )

    – carlcaulkett Dec 03 '23 at 18:14
  • Awesome, you can always edit the post if needed. The links I provided have apps that provide importers for public.data which is the most generic file type possible. Installing apps could also add proper typing for those files. What framework or language are they? – bmike Dec 03 '23 at 18:16
  • I'm trying to use the 3 backticks in order to put the text in a mono-spaced font, but ask.different won't have it! In answer to your last question, .mojo files are plain text files which hold source code for the Mojo programming language which is essentially a compiled super-set of Python! I'll check out those links. Thanks again! – carlcaulkett Dec 03 '23 at 18:22
  • Perfect. Pycharm might be an excellent editor to install (and VSCode too) if they add importer for python files, they might carry over to mojo and you don’t have to use them at all. – bmike Dec 03 '23 at 18:28
  • I tried the "solution for 2021" at the bottom of this page, but while pressing space on a .mojo file now brings up a window, it doesn't show much, unless they're using the white text on a white background approach – carlcaulkett Dec 03 '23 at 18:37
  • I'm using Cursor which is an AI powered VSCode clone, for which there is already (Mojo is a very young language!) a very capable plugin with syntax highlighting. It's really just the QuickView capability I'm after. – carlcaulkett Dec 03 '23 at 18:40

0 Answers0