Saturday, January 21, 2012

Re: Prefix lines with a counter

Another solution is to make them all start with "1. " and then use pandoc to tidy them up. Adding the "1. " is easy: `:s/^/1. /`.  I have

   set equalprg=pandoc -t markdown

So if I have something like

   1. item 1
   1. item 2
   1. item 3

and select them all in visual mode (`vip` works for this---maybe that depends on some plugin, not sure) and hit '=' to get a nicely formatted numbered list. A nice feature of this solution, for writing markdown, is that it generalizes. I can quickly clean up blockquotes, quickly transform ATX headers to setext headers, and so on.

David

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: