Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#D3201F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff: changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#BF3904</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff: inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
<key>foreground</key>
<string>#219186</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown: Linebreak</string>
<key>scope</key>
<string>text.html.markdown meta.dummy.line-break</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#A57706</string>
<key>foreground</key>
<string>#E0EDDD</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown: Raw</string>
<key>scope</key>
<string>text.html.markdown markup.raw.inline</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#269186</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Heading</string>
<key>scope</key>
<string>markup.heading</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#cb4b16</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Italic</string>
<key>scope</key>
<string>markup.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#839496</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Bold</string>
<key>scope</key>
<string>markup.bold</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#586e75</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Underline</string>
<key>scope</key>
<string>markup.underline</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>underline</string>
<key>foreground</key>
<string>#839496</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Quote</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#268bd2</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: List</string>
<key>scope</key>
<string>markup.list</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#657b83</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Raw</string>
<key>scope</key>
<string>markup.raw</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#b58900</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup: Separator</string>
<key>scope</key>
<string>meta.separator</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#eee8d5</string>
<key>fontStyle</key>
<string>bold</string>
<key>foreground</key>
<string>#268bd2</string>
</dict>
</dict>
@42thcoder

This comment has been minimized.

Copy link

@42thcoder 42thcoder commented Jun 3, 2012

How can I use it?

@sean-clayton

This comment has been minimized.

Copy link

@sean-clayton sean-clayton commented Jul 7, 2012

@42thcoder First, you must open your preferred theme. Then, you drop this guy in there, after the last </dict>, before </array>.

@ka8725

This comment has been minimized.

Copy link

@ka8725 ka8725 commented Jul 11, 2012

Thank you!

@ssilva

This comment has been minimized.

Copy link

@ssilva ssilva commented Jul 16, 2012

Thanks a lot!
I'm using this with Monokai Bright.

@jonathanbell

This comment has been minimized.

Copy link

@jonathanbell jonathanbell commented Nov 3, 2012

THANK YOU! :)

@masondesu

This comment has been minimized.

Copy link

@masondesu masondesu commented Jan 13, 2013

Righteous. Thanks a ton, dude!

@weisjohn

This comment has been minimized.

Copy link

@weisjohn weisjohn commented Jan 15, 2013

Love this!

@Karmak23

This comment has been minimized.

Copy link

@Karmak23 Karmak23 commented Jan 26, 2013

Hi, I use "Nexus" theme on ST 2.0.1 on Linux (Ubuntu 12.10).

I appended your code at the end of ~/.config/sublime-text-2/Packages/Theme - Nexus/Nexus.tmTheme before the last , then restarted ST2.

But my .md files are still not highlighted. In View > Syntax, they are autodetected as Markdown correctly.

I tried to swith theme back and forth, but still no color.

I think I'm missing something obvious, but I can't figure why. Any advice ?

@jwebcat

This comment has been minimized.

Copy link

@jwebcat jwebcat commented Feb 28, 2013

not working for me either. I'm using soda dark theme.

I pasted after the last dict and before array then restarted with no dice.

im using monokai dark color scheme I don't know if that makes a difference.


@Karmak23

so if your using a default color scheme you will neede to edit the corresponding file in this dir C:\Users\Owner\AppData\Roaming\Sublime Text 2\Packages\Color Scheme - Default (on Windows)

I got it to work. I am using a custom version of monokai dark and I had to paste the above snippet into my MonokaiSoda.tmTheme located at C:\Users\Owner\AppData\Roaming\Sublime Text 2\Packages\User on my windows 7 install. All is well.

It's working like a charm, btw no need to restart st2 it should work as soon as you save the file.

@SteveViss

This comment has been minimized.

Copy link

@SteveViss SteveViss commented Apr 4, 2013

Thanks, very helpful !

@ibes

This comment has been minimized.

Copy link

@ibes ibes commented May 20, 2013

Thanks - works for me!

@jsmarkus

This comment has been minimized.

Copy link

@jsmarkus jsmarkus commented May 22, 2013

Thanks!

@firejdl

This comment has been minimized.

Copy link

@firejdl firejdl commented Jun 14, 2013

Very nice, thanks!

@aahan

This comment has been minimized.

Copy link

@aahan aahan commented Jun 14, 2013

Go to Sublime Text > Preferences > Color Scheme > select Cobalt, Dawn, or Sunburst. These themes have full support for markdown syntax highlighting by default. Just saying!

@enahs

This comment has been minimized.

Copy link

@enahs enahs commented Jul 16, 2013

OS X Users: the files you wish to modify live here:

/Users/[your user name here]/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default

If using Monokai, you'll want to remove this bit:

<dict>
    <key>name</key>
    <string>Markdown: Linebreak</string>
    <key>scope</key>
    <string>text.html.markdown meta.dummy.line-break</string>
    <key>settings</key>
    <dict>
        <key>background</key>
        <string>#A57706</string>
        <key>foreground</key>
        <string>#E0EDDD</string>
    </dict>
</dict>

As the line breaks look really ugly.

@mfdj

This comment has been minimized.

Copy link

@mfdj mfdj commented Aug 25, 2013

Awesome.
Although presently the indentation is a little irregular from lines 2–68 — otherwise seems to work perfectly as a drop-in addition to Monokai.

@lorddev

This comment has been minimized.

Copy link

@lorddev lorddev commented Nov 1, 2013

Thanks @aahan!. I really prefer Monokai, but this is enough to make me switch. Space cadet and Twilight and a few other themes support it as well, though I haven't checked all of them. I'm going to use Twilight, I think.

@imderek

This comment has been minimized.

Copy link

@imderek imderek commented Nov 22, 2013

Thanks for this!

@jiangyuan

This comment has been minimized.

Copy link

@jiangyuan jiangyuan commented Dec 4, 2013

Can anybody tell me the syntax of this xml ?
I want to change it by myself.
@aahan @enahs

@hdngr

This comment has been minimized.

Copy link

@hdngr hdngr commented Dec 21, 2013

Thanks @CrazyApi!

@mattfiocca

This comment has been minimized.

Copy link

@mattfiocca mattfiocca commented Jan 15, 2014

Looks great. What can i add to this that would highlight code blocks? e.g.:

my code

Everything else is highlighted pretty well, like inline code: my code. To clarify, i'm not looking for syntax highlighting on the code, just a way to colorize the whole block apart from paragraph text. I'm using Monokai

@rginnow

This comment has been minimized.

Copy link

@rginnow rginnow commented Feb 28, 2014

Thanks! Got it working with the Flatland_Monokai Theme!

@shangbo

This comment has been minimized.

Copy link

@shangbo shangbo commented Apr 13, 2014

Good Job!thank you,I spent lots of time on finding these code!

@chestozo

This comment has been minimized.

Copy link

@chestozo chestozo commented Jun 22, 2014

👍

@aurelkurtula

This comment has been minimized.

Copy link

@aurelkurtula aurelkurtula commented Jun 15, 2015

Is it possible to add padding? I have this:

<dict>
    <key>name</key>
    <string>Markup: Raw block</string>
    <key>scope</key>
    <string>markup.raw.block</string>
    <key>settings</key>
      <dict>
        <key>foreground</key>
        <string>#6f6f6f</string>
        <key>background</key>
        <string>#2a2a2a</string>
    </dict>
</dict>

(it might be what @mattfiocca wanted)

Is there a way to add some padding? For example

<key>PaddingTop</key><string>50</string>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment