As I mentioned previously, I’ve converted the little python link gathering doodad I did into a command for Sublime Text 2. But, because I am an aggressive footnoter, I decided I wanted some convenience functions for footnotes.1 And so I made some. Hooray.
The results are up at my fork of the MarkdownEditing Package. The furnished commands are pretty simple.
- Insert footnote. Press
^⌘62 to insert a footnote after the current word.3
- Gather missing footnotes.
⌘⌥⇧gwill look for footnote markers that aren’t currently defined and add markers at the bottom of your document. Not so useful by itself, I admit, but useful in conjunction with the next:
- Switch to/from footnote definition.
^⌥6will switch between the text of a footnote and its references. So: if my cursor is in a footnote, and I press
^⌥6, ST2 will select the references to the footnote in the body text. If my cursor is in a body paragraph,
^⌥6will identify the next footnote reference and take me to its text.
- Sort footnotes. If you saw this post initially, you saw that my footnotes were out of order. Inserting a new footnote before an existing footnote will result in the notes being added out of order, and at least in the flavor of Markdown I’m using,4 this results in sorting oddities. (So: in the previous version of the post, the reference to footnote 4 came before footnote 1, and but footnote 1 came first in the
olat the bottom of the page.) Now,
⌘^swill sort the footnotes in the order in which they appear in the document. This affects the sorting of the
ol, which in turn corrects the problem with marker ordering.
^6is a magic command that combines most of these commands. It does the following:
- If the current selection is in the text of a footnote, it moves the cursor to the corresponding reference(s).
- If the current selection is in a footnote reference, it moves the cursor to the corresponding footnote text.
- If the current selection is neither (i.e., in the main text), it creates a new footnote.
Between these, this makes it really easy to go back and forth from footnotes to text. When I need to write a footnote,
^6 will insert a new footnote, thusly.5 Easy as can be.
This works by scanning the current file for Multimarkdown footnote markers, identifying those that are numeric, and providing the next integer—so you shouldn’t have any marker collisions. ↩
And when I’m done writing the footnote text,
^6will take me back to the top. ↩