My ultimate Markdown editor wishlist
There are a few great Markdown text editors available, and more being worked on right now. I want to put a list of features out there that I think any true Markdown editor should include. Some of these are implemented in one editor or another, but nothing has brought it all together (aside from TextMate with all of my customizations, and even that lacks some of the polish mentioned below).
The wish list
-
Emphasis shortcuts for selected text
Preferably Command-B and Command-I. Selection should remain (expanded to include inserted emphasis characters) so that I can add multiple emphasis if I want. Typing any characters other than emphasis or auto-paired characters (including Space) at this point should move the cursor to the right, deselecting the text and continuing to type after the emphasis end.
-
Intelligent indentation
Creating a newline should maintain the previous line’s indentation, except when ending a list, in which case the indentation should be removed. Pasting text should remove indentation from the text and preserve the current indentation of the preceding line.
-
List continuation
Pressing enter at the end of a list item should create a new list item at the same indentation level and with the same list type, incrementing the number if it’s an ordered list. Pressing return on a line that contains only the list item delimiter (no text) should remove that delimiter and insert a newline. Never leave me with an orphaned, empty list item.
-
Auto-pairing
Needs to be smart enough to know when not to pair: Avoid pairing when inserting a starting element when there’s a non-whitespace character immediately to right, or when inserting a paired element at the end of a string that begins with an unclosed starting element.
Backspacing the first character of a pair immediately followed by the right character should delete both of them.
Obvious note: Characters inserted in this way must have the cursor placed between the resulting pair.
-
Wrapping
When the first element of a pair is typed while text is selected, it should wrap the selected text with the pair. Unlike pairing, the cursor should be placed outside of the last character of the pair, allowing you to start typing immediately.
-
Link pasting
Elastic Threads has worked some really intelligent link paste detection into nvALT, and I love it. If a link is pasted while text is selected, it adds an inline link to the selected text using the pasted url. If it’s at the beginning of a line, you can paste it as a reference title and position the cursor inside the title brackets. Pasted by itself with leading and trailing whitespace, it should make a self-link (
<url>
). -
Tab indents entire selection block
God help you if Tab deletes a selection instead. Shift-Tab should function in the same way, outdenting entire selections.
-
Shortcuts for moving lines up and down and indenting and outdenting.
This should function on any line, not just within lists. If a current selection is shorter than the current line, the entire line moves, and if it spans multiple lines, the entire block moves including characters within the paragraph but outside of the selection.
-
Auto-complete reference titles
When the cursor is inside of square brackets immediately following a closing square bracket, it should start type-ahead autocompletion using all existing references in the document.
- Table of contents navigation based on existing headers, and shortcuts to jump to the next/previous header.
-
Footnote insertion
When a hotkey is pressed, a footnote marker should be added and the cursor should jump to a blank line after the current paragraph, inserting newline and a matching reference. Once you finish editing the footnote, the same hotkey should jump back to the footnote marker. I’ve already made this work in the Blogsmith bundle. It’s not that hard.
This same method could be applied to reference links. When a shortcut is pressed while there is selected text, wrap the text with
[text][unique title]
and move the cursor to the next blank line or existing reference link title, insert[unique title]:
and place the cursor after the colon and a trailing space. Using the shortcut immediately after typing should return to the last edit point in the text. Pressing the shortcut on a line beginning with a reference title should scan the document for the first reference to that title and jump to it. -
Headline level conversion
Shortcut should increment/decrement header level for the current line, cycling from 0-6 and looping at beginning/end.
-
List creation/conversion
Running this on multiple lines should compact them into a list, preserving indentation. Running it on an existing list should change the list type between unordered and ordered. Needs to be aware of context, only changing within the current scope of indentation and not modifying nested lists. Byword does a really good job with this already.
-
Blockquote level shortcut
Using this shortcut should create a blockquote from the current line or selected text, and increase the quote level for the line/selection when pressed repeatedly.
-
Reference list insertion
There should be an option to parse the clipboard for all links and insert a set of reference links with a unique title for each, preferably based on the domain of the link for easier use when referencing later. The Blogsmith Bundle and my Markdown Service tools both include this feature.
-
Ability to convert all inline links to references
Should scan the entire document for inline links and replace them with reference links, references collected at the end of the document. The Markdown Service Tools have this capability, but Writing Kit on iOS is the only other place I’ve seen it implemented.
-
Shift-Return and Command-Return
Shift-Return (or possibly Control-Return) should insert two spaces and a newline to create a hard break. Command-Return should jump to the end of the current paragraph/line and insert a newline, allowing you to jump out of the middle of a line without breaking it. Command-Shift-Return should function like Command-Return, but add the two spaces before inserting the newline.
-
Command-Arrow
Command-Left/Right Arrow should jump to the first non-whitespace character of a paragraph, only jumping to the actual beginning of the line on second press. If the current line is wrapped on the screen, jump to the left side of the current line and then to the first character on a repeat press, just to maintain basic compatiblity with existing behavior.
Choose your own adventure
This list isn’t complete, but it includes the major things that I find missing (or would just like to see) in current implementations. Have any to add? I’ll edit this post as I think of more or hear good suggestions. Keep in mind that this represents my personal desires, not necessarily yours. I’m also open to hearing from developers who think any of these might be more cumbersome or confusing than helpful, especially if you have suggestions for modification.