Home » Mac OS » macOS: Preview source code files in Finder with Quick Look plugins

About Rafal Borowiec

Rafal Borowiec
Software developer, Team Leader, Agile practitioner, occasional blogger, lecturer. Open Source enthusiast, quality oriented and open-minded.

macOS: Preview source code files in Finder with Quick Look plugins

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

Example: preview .gitignore:

  • Preview Markdown files in Finder with QLMarkdown:

     brew cask install qlmarkdown

Example: preview README.md:

  • Syntax highlighting for source code files with QLColorCode

     brew cask install qlcolorcode

Example: preview JavaScript file:

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 Esc.

Change default editor for selected file types

To change the default app for the selected file type (also in Quick Look):

  1. Select the file in Finder
  2. Show file info with Command+I
  3. Set Open With to your application (e.g. Atom)
  4. Click Change All to 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:

macOS: Annotate – simple yet productive screenshots tool

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.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a sysadmin Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. Introduction to NGINX
2. Apache HTTP Server Cookbook
3. VirtualBox Essentials
4. Nagios Monitoring Cookbook
5. Linux BASH Programming Cookbook
6. Postgresql Database Tutorial
and many more ....
I agree to the Terms and Privacy Policy

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of