diff --git a/README.markdown b/README.markdown index e87daf1..6e6e65f 100644 --- a/README.markdown +++ b/README.markdown @@ -21,6 +21,7 @@ Here is some text.[^1] [^1]: Here is a note. ~~~ +) The footnote number gets determined by an automatic counter whenever a new footnote gets inserted. The counter works with the default arabic numerals @@ -28,18 +29,13 @@ and all other settings provided by `b:vimfootnotetype`. The automatic counter code is based on the code for the counting of HTML footnotes in [this post by Nick Coleman][3], adjusted slightly to work with Markdown footnotes. -The script defines two mappings, +To insert a footnote, hit `f` in normal mode or type `[]`. Then -~~~ -f Insert new footnote -r Return from footnote -~~~ +- A footnote mark will be inserted after the cursor, +- A matching footnote mark will be inserted at the end of the file, and +- a split window at the bottom will open, ready to edit the new footnote. -To insert a footnote, type `f`. A footnote mark will be inserted -after the cursor. A matching footnote mark will be inserted at the end -of the file. A new buffer will open in a split window at the bottom of -your screen, ready to edit the new footnote. When you are done, type -`r` to close the split and return to the main text. +When done, type `ZZ` to close the split and return to the main text. ![Screenshot][5] diff --git a/doc/markdownfootnotes.txt b/doc/markdownfootnotes.txt index b5be9d6..c431ac6 100644 --- a/doc/markdownfootnotes.txt +++ b/doc/markdownfootnotes.txt @@ -4,11 +4,13 @@ markdown-footnotes, add footnotes in markdown *markdown-footnotes* *footnotes* 0. Introduction ~ *markdown-footnotes-intro* -To insert a footnote, type `f`. A footnote mark will be inserted -after the cursor. A matching footnote mark will be inserted at the end -of the file. A new buffer will open in a split window at the bottom of -your screen, ready to edit the new footnote. When you are done, type -`r` to close the split and return to the main text. +To insert a footnote, hit `f` in normal mode or type `[]`. Then + +- A footnote mark will be inserted after the cursor, +- A matching footnote mark will be inserted at the end of the file, and +- a split window at the bottom will open, ready to edit the new footnote. + +When done, type `ZZ` to close the split and return to the main text. =========================================================================== 1. Commands ~ diff --git a/ftplugin/markdown/markdownfootnotes.vim b/ftplugin/markdown/markdownfootnotes.vim index 267e711..9420729 100644 --- a/ftplugin/markdown/markdownfootnotes.vim +++ b/ftplugin/markdown/markdownfootnotes.vim @@ -106,25 +106,15 @@ endif " Mappings if !hasmapto('AddVimFootnote', 'i') && mapcheck('f', 'i') is# '' - imap f AddVimFootnote + inoreabbrev [] :exe "normal \AddVimFootnote" endif if !hasmapto('AddVimFootnote', 'n') && mapcheck('f', 'n') is# "" nmap f AddVimFootnote endif -if !hasmapto('ReturnFromFootnote', 'i') && mapcheck('r', 'i') is# '' - imap r ReturnFromFootnote -endif -if !hasmapto('ReturnFromFootnote', 'n') && mapcheck('r', 'n') is# '' - nmap r ReturnFromFootnote -endif - nnoremap AddVimFootnote :call markdownfootnotes#VimFootnotes('a') inoremap AddVimFootnote :call markdownfootnotes#VimFootnotes('a') -inoremap ReturnFromFootnote :q -nnoremap ReturnFromFootnote :q - " :Footnote commands command! -buffer -nargs=1 FootnoteNumber call markdownfootnotes#VimFootnoteNumber() command! -buffer -nargs=0 FootnoteNumberRestore call markdownfootnotes#VimFootnoteNumberRestore()