Sublime Text 3에서 Markdown Syntax Highlighting 적용하기

Sublime Text 3로 Markdown 문서를 편집하고 Marked 2로 Preview를 확인하면서 글을 작성하는 연습을 하고 있습니다.

Sublime Text 3의 아쉬운 점은 Markdown Syntax Highlighting을 지원하지 않더군요. 구글 검색을 통해 관련 문서를 찾았는데, 기본적으로는 버전 2에서 적용방법을 설명하고 있지만, 댓글에 버전 3을 위한 적용방법도 나와 있어 여기에 정리하여 공유합니다.

~/Library/Application Support/Sublime Text 3/Packages/User/customizedMonokai.tmTheme 파일에 다음 내용을 붙여 넣습니다. (기본 테마의 끝부분에 Markdown을 위한 테마를 추가한 것입니다.)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Monokai</string>
    <key>settings</key>
    <array>
        <dict>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#272822</string>
                <key>caret</key>
                <string>#F8F8F0</string>
                <key>foreground</key>
                <string>#F8F8F2</string>
                <key>invisibles</key>
                <string>#3B3A32</string>
                <key>lineHighlight</key>
                <string>#3E3D32</string>
                <key>selection</key>
                <string>#49483E</string>
                <key>findHighlight</key>
                <string>#FFE792</string>
                <key>findHighlightForeground</key>
                <string>#000000</string>
                <key>selectionBorder</key>
                <string>#222218</string>
                <key>activeGuide</key>
                <string>#9D550FB0</string>

                <key>bracketsForeground</key>
                <string>#F8F8F2A5</string>
                <key>bracketsOptions</key>
                <string>underline</string>

                <key>bracketContentsForeground</key>
                <string>#F8F8F2A5</string>
                <key>bracketContentsOptions</key>
                <string>underline</string>

                <key>tagsOptions</key>
                <string>stippled_underline</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Comment</string>
            <key>scope</key>
            <string>comment</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#75715E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>String</string>
            <key>scope</key>
            <string>string</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#E6DB74</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Number</string>
            <key>scope</key>
            <string>constant.numeric</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#AE81FF</string>
            </dict>
        </dict>

        <dict>
            <key>name</key>
            <string>Built-in constant</string>
            <key>scope</key>
            <string>constant.language</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#AE81FF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>User-defined constant</string>
            <key>scope</key>
            <string>constant.character, constant.other</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#AE81FF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Variable</string>
            <key>scope</key>
            <string>variable</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Keyword</string>
            <key>scope</key>
            <string>keyword</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#F92672</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Storage</string>
            <key>scope</key>
            <string>storage</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#F92672</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Storage type</string>
            <key>scope</key>
            <string>storage.type</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#66D9EF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Class name</string>
            <key>scope</key>
            <string>entity.name.class</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>underline</string>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Inherited class</string>
            <key>scope</key>
            <string>entity.other.inherited-class</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic underline</string>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Function name</string>
            <key>scope</key>
            <string>entity.name.function</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Function argument</string>
            <key>scope</key>
            <string>variable.parameter</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#FD971F</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Tag name</string>
            <key>scope</key>
            <string>entity.name.tag</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#F92672</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Tag attribute</string>
            <key>scope</key>
            <string>entity.other.attribute-name</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Library function</string>
            <key>scope</key>
            <string>support.function</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#66D9EF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Library constant</string>
            <key>scope</key>
            <string>support.constant</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#66D9EF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Library class/type</string>
            <key>scope</key>
            <string>support.type, support.class</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#66D9EF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Library variable</string>
            <key>scope</key>
            <string>support.other.variable</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string></string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Invalid</string>
            <key>scope</key>
            <string>invalid</string>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#F92672</string>
                <key>fontStyle</key>
                <string></string>
                <key>foreground</key>
                <string>#F8F8F0</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>Invalid deprecated</string>
            <key>scope</key>
            <string>invalid.deprecated</string>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#AE81FF</string>
                <key>foreground</key>
                <string>#F8F8F0</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>JSON String</string>
            <key>scope</key>
            <string>meta.structure.dictionary.json string.quoted.double.json</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#CFCFC2</string>
            </dict>
        </dict>

        <dict>
            <key>name</key>
            <string>diff.header</string>
            <key>scope</key>
            <string>meta.diff, meta.diff.header</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#75715E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.deleted</string>
            <key>scope</key>
            <string>markup.deleted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#F92672</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.inserted</string>
            <key>scope</key>
            <string>markup.inserted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.changed</string>
            <key>scope</key>
            <string>markup.changed</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#E6DB74</string>
            </dict>
        </dict>

        <dict>
            <key>scope</key>
            <string>constant.numeric.line-number.find-in-files - match</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#AE81FFA0</string>
            </dict>
        </dict>
        <dict>
            <key>scope</key>
            <string>entity.name.filename</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#E6DB74</string>
            </dict>
        </dict>

        <dict>
            <key>scope</key>
            <string>message.error</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#F83333</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>Markdown: Punctuation for Inline Block</string>
  <key>scope</key>
  <string>punctuation.definition.raw.markdown</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>Markdown: Punctuation for Bold, Italic</string>
  <key>scope</key>
  <string>punctuation.definition.bold.markdown, punctuation.definition.italic.markdown</string>
  <key>settings</key>
  <dict>
    <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: 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>

    </array>
    <key>uuid</key>
    <string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
</dict>
</plist>

Sublime Text 3에서 Preferences > Settings - User 메뉴를 실행하면 Preferences.sublime-settings 파일이 열립니다. 아래와 같이 수정해 줍니다.

// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
    "color_scheme": "Packages/User/customizedMonokai.tmTheme"
}

결과는 이렇습니다.

스크린샷 2013-10-31 오후 10.57.36

댓글 남기기

댓글 남기기