macOS Finder offers a possibility to preview the files of any type without opening them with Quick Look. By default Quick Look supports most commonly used file formats which may not be enough if you are a developer and you want to preview source code files i.e. Java or Python or any other un-common file types.
Quick Look plugins
Quick Look can be extended with plugins to allow previewing the content of any file format. Plugins can also add additional functionality to Quick Look like for example syntax highlighting.
The list of freely available Quick Look plugins for developers can be found here: https://github.com/sindresorhus/quick-look-plugins
The most useful ones from my point of view:
- Preview files with no extension with QLStephen:
brew cask install qlstephen
- Preview Markdown files in Finder with QLMarkdown:
brew cask install qlmarkdown
- Syntax highlighting for source code files with QLColorCode
brew cask install qlcolorcode
Tips and Tricks
Quick Look in fullscreen
The default key binding for Quick Look is
Spacebar If you you want to preview the file in fullscreen press
Option+Spacebar. To leave the fullscreen press
Change default editor for selected file types
To change the default app for the selected file type (also in Quick Look):
- Select the file in Finder
- Show file info with
Open Withto your application (e.g. Atom)
Change Allto apply changes to all files of that type
Now when you for example preview the file with Quick Look your default editor will be the one you just selected.
More macOS tips:
Published on System Code Geeks with permission by Rafal Borowiec, partner at our SCG program. See the original article here: macOS: Preview source code files in Finder with Quick Look plugins
Opinions expressed by System Code Geeks contributors are their own.