Tip #332: make footnotes in vim
tip karma |
Rating 14/5, Viewed by 1215
|
created: |
|
September 23, 2002 3:43 |
|
complexity: |
|
basic |
author: |
|
[email protected] |
|
as of Vim: |
|
6.0 |
I found at http://groups.google.com/groups?q=vim+changing+shell+to+zsh&hl;=en&lr;=&ie;=UTF-8&selm;=S_Rh9.716%24a5.124150%40news.uchicago.edu&rnum;=4
a macro to insert footnotes in vim, but it doesn't work as of vim6.0.
so i wrote my own; this macro requires two differents shortcuts, one for entering the first footnote, the other one for all subsequent footnotes.
when you hit "K0" (first footnote) or "KK" (all other footnotes) in normal mode, your cursor is positionned at the end of the document, in the footnote & in insert mode. The "a" bookmark is set to the place where you entered the footnote in the text. so a "`a" will bring you back to the location of the footnote in the text.
" for now requires entering K0 for the first footnote and then KK nmap K0 i[0]<esc>maG$i<end><enter>[0]
nmap KK maG$?\[[0-9]*\]<enter>yt]G$i<end><enter><esc>p<C-a>i<end>]<esc>`aP<C-a><right>i]<esc>maG$i<end><end>
<<modline magic... |
Syntax-based folding for c/c++/java >>
Additional Notes
|