---
title: 'Markdown Editing for Sublime Text 2: humble beginnings'
date: 2012-05-17 17:30
slug: markdown-editing-for-sublime-text-2-humble-beginnings
categories:
- Code
tags:
- markdown
- multimarkdown
- sublimetext
---

<img src="/uploads/2012/05/sublime_markdown_editor_shot.jpg" alt="Sublime Markdown Editor Shot" height="235" width="650" class="aligncenter" style="border: solid 1px #aaa" >

I was disappointed to find that there weren't any good packages available for [Sublime Text 2](http://www.sublimetext.com/2) that added decent Markdown editing features. I figured it was time to learn my way around. I still haven't dug into Python, so my script-fu in there is weak right now. I got a few things working, though, and this will evolve as I learn new things. I'll probably look back at this first version with embarrassment, but I'll just overwrite it with better stuff as it progresses.

From the README on the [Github repo](http://ttscoff.github.com/MarkdownEditing):

This package will make MarkdownEditor your default theme for Markdown/MultiMarkdown files. Adjust it to your liking or remove the line from the .sublime-settings files

* Asterisks and underscores are autopaired and will wrap selected text
* If you start an empty pair and hit backspace, both elements are deleted
* If you start an empty pair and hit space, the right element is deleted
* backticks are paired
* Left bracket pairing is modified to eliminate the selection and leave the cursor at a point where you can insert a `[]` or `()` pair for a link
* V will paste the contents of the clipboard as an inline link on selected text
* R will paste the contents of the clipboard as a reference link
* K inserts a standard inline link, K inserts an inline image
* B and I are bound to bold and italics (Markdown). *If you don't like losing your default shortcut for "Build", modify the sublime-keymap file. This only overrides while editing Markdown files.*

There's a long way to go and I have a lot of Python to learn.

The theme pays some homage to [Byword](http://bywordapp.com), but I make no pretense that it's anywhere as pretty.

### Installation

Just download or clone the [MarkdownEditing repo](http://ttscoff.github.com/MarkdownEditing) into a MarkdownEditing folder within your `~/Library/Application Support/Sublime Text 2/Packages` folder. You may have to restart Sublime to get it working, but once it's installed (if all goes well), you should be able to open a Markdown file and see my custom theme. If you do, then the features listed above should also be available.

Right now, this is designed to be tweaked. I can't guess what you're preferred editing environment is like, so I went with mine. I'd love to see any permutations you come up with.

Oh, and by the way, if you're doing any theming for Sublime Text, here's a handy little plugin I whipped up to copy the scope of the character after the cursor to the clipboard for easily adding keys to a .tmtheme XML file:



```python
import sublime, sublime_plugin

class CopyScopeCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		sublime.set_clipboard(self.view.scope_name(self.view.sel()[0].begin()))
		sublime.status_message("Copied scope")

	def is_enabled(self):
		return self.view.sel()

# To call the command, add the following to Preferences->Key Bindings - User:
# { "keys": ["shift+super+alt+p"], "command": "copy_scope" }
```

[View the code on GitHub](https://gist.github.com/2721811)



Also check out Philip Belesky's [Byworded themes](https://github.com/philipbelesky/Byworded) for TextMate and Sublime Text 2.

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
