1- ## VimFootnotes for Markdown
1+ ## VimFootnotes for Markdown with automatic footnote counter
22
3- This fork is a slight tweak of the venerable [ vimfootnotes] [ ] , for use
4- with extended markdown.
3+ This fork derived from [ this vim-plugin by David Sanson] [ 1 ] , which in turn is
4+ a slight tweak of the venerable [ vimfootnotes] [ 2 ] , for use with extended
5+ markdown.
56
6- The original script inserts footnotes that look like this:
7+ The new script inserts footnotes in the widely supported extended markdown
8+ syntax with the addition of ` fn ` as a prefix to the current footnote number.
79
810~~~
9- Here is some text.[1 ]
11+ Here is some text.[^fn1 ]
1012
11- [1] Here is a note.
13+ [^fn1]: Here is a note.
1214~~~
1315
14- The new script inserts footnotes in the widely supported extended
15- markdown syntax,
16+ The footnote number gets determined by an automatic counter whenever a new
17+ footnote gets inserted. This renders the commands ` FootnoteNumber ` ,
18+ ` FootnoteNumberRestore ` and ` FootnoteUndo ` essentially useless...
1619
17- ~~~
18- Here is some text.[^1]
20+ The counter works with the default arabic numerals and all other settings
21+ provided by ` b:vimfootnotetype ` .
1922
20- [^1]: Here is a note.
21- ~~~
23+ I did not write the counter myself. I found the code for the counting of HTML
24+ footnotes in [ this post by Nick Coleman] [ 3 ] , adjusted it slightly to work with
25+ Markdown footnotes and cobbled it into the original plugin from David Sanson.
2226
23- The original script inserts footnotes at the end of the file ** or**
24- before an email sig line, if any. The new script inserts all footnotes at the
25- end of the file.
27+ All praise belong to these two fine gentlemen, all errors are mine.
2628
2729The script defines two mappings,
2830
@@ -37,13 +39,13 @@ of the file. A new buffer will open in a split window at the bottom of
3739your screen, ready to edit the new footnote. When you are done, type
3840` <Leader>r ` to close the split and return to the main text.
3941
40- ![ Screenshot] ( https://raw.github.com/vim-pandoc/vim-markdownfootnotes/master/footnotes.png )
42+ ![ Screenshot] [ 5 ]
4143
4244## Installation
4345
4446Drop ` markdownfootnotes.vim ` in your plugin directory.
4547
46- Or use [ Pathogen] ( https://github.com/tpope/vim-pathogen ) .
48+ Or use [ Pathogen] [ 6 ] .
4749
4850## Settings
4951
@@ -91,13 +93,9 @@ previous type, then the counter will not be restarted.
9193` FootnoteRestore `
9294 : Restore previous footnote type and counter.
9395
94- ## Todo
95-
96- 1 . It would not be hard to add support for other plaintext footnote
97- formats, triggered by filetype.
98- 2 . I have not really looked very carefully at how the script is
99- implemented. I suspect there are ways in which it could be
100- refactored and streamlined.
101-
10296
103- [ vimfootnotes ] : http://www.vim.org/scripts/script.php?script_id=431
97+ [ 1 ] : https://github.com/vim-pandoc/vim-markdownfootnotes/
98+ [ 2 ] : http://www.vim.org/scripts/script.php?script_id=431
99+ [ 3 ] : http://www.nickcoleman.org/blog/index.cgi?post=footnotevim%21201102211201%21programming
100+ [ 5 ] : https://raw.github.com/vim-pandoc/vim-markdownfootnotes/master/footnotes.png
101+ [ 6 ] : https://github.com/tpope/vim-pathogen
0 commit comments