Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Created June 5, 2012 07:34
Show Gist options
  • Save sindresorhus/2873338 to your computer and use it in GitHub Desktop.
Save sindresorhus/2873338 to your computer and use it in GitHub Desktop.
How to write your Markdown in Sublime Text 2 and preview in Mou

How to write your Markdown in Sublime Text 2 and preview in Mou

I use Sublime for everything text related, but it doesn't have any built-in way to preview my Markdown files.

This is how easy it is to preview in Mou:

  • In Sublime, go to Tools -> Build System -> New Build System...
  • In the newly opened file, replace the file contents with this and save: { "osx": { "cmd": ["open", "-a", "Mou", "$file"] }, "selector": "text.html.markdown" }
  • Restart Sublime

You can now use ⌘B or F7 to preview in Mou.

Even though I only showed you how to preview Markdown files in Mou. This could easily be applied to any file type and app.

More about the Build System here: http://readthedocs.org/docs/sublime-text-unofficial-documentation/en/latest/file_processing/build_systems.html

Mou is an awesome Markdown editor: http://mouapp.com I use it because it's fast and I can preview how my Markdown will look on GitHub: Preferences -> CSS -> GitHub The GitHub CSS in the app is a little outdated, you can get the fresh one here https://github.com/gcollazo/mou-theme-github2 and just put it in ~/Library/Application Support/Mou/CSS/

Note that there is currently one shortcoming with using this. Mou doesn't update the file if it's given a currently open file, which makes you have to do ⌘W after a preview. I've emailed the author, so hopefully this will be fixed soon

@obstschale
Copy link

Thx - This is exactly what I was looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment