1
- ## VimFootnotes for Markdown
1
+ ## VimFootnotes for Markdown with automatic footnote counter
2
2
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.
5
6
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.
7
9
8
10
~~~
9
- Here is some text.[1 ]
11
+ Here is some text.[^fn1 ]
10
12
11
- [1] Here is a note.
13
+ [^fn1]: Here is a note.
12
14
~~~
13
15
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...
16
19
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 ` .
19
22
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.
22
26
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.
26
28
27
29
The script defines two mappings,
28
30
@@ -37,13 +39,13 @@ of the file. A new buffer will open in a split window at the bottom of
37
39
your screen, ready to edit the new footnote. When you are done, type
38
40
` <Leader>r ` to close the split and return to the main text.
39
41
40
- ![ Screenshot] ( https://raw.github.com/vim-pandoc/vim-markdownfootnotes/master/footnotes.png )
42
+ ![ Screenshot] [ 5 ]
41
43
42
44
## Installation
43
45
44
46
Drop ` markdownfootnotes.vim ` in your plugin directory.
45
47
46
- Or use [ Pathogen] ( https://github.com/tpope/vim-pathogen ) .
48
+ Or use [ Pathogen] [ 6 ] .
47
49
48
50
## Settings
49
51
@@ -91,13 +93,9 @@ previous type, then the counter will not be restarted.
91
93
` FootnoteRestore `
92
94
: Restore previous footnote type and counter.
93
95
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
-
102
96
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