Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Created June 5, 2012 07:34
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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

@mihaipaun
Copy link

Thanks for this! I was trying to use the markdown preview plugin but with no luck. It works well is you need a generated HTML file though.
Also, it looks like Mou now comes with the updated CSS file so there's no need to get it from that repo: http://cl.ly/image/122q3l3V0W3D

@sindresorhus
Copy link
Author

I'm actually using Marked now instead. It's much better: http://markedapp.com

Going to write about it sometime in the future.

@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