pretty new to vim, so my solution may work improperly
:for i in range(1, N)
:exe "norm I".i."."
:norm n
:endfor
N is the sum of lines. move cursor to first line before doing this.
OR u can use :h function-list
first reply to vim_use..en ...... :)
Anhong.He
Here is something I constantly find myself needing to do:
Start with a list of items delineated by line breaks:
foo
bar
baz
And turn it into a markdown numbered list:
1. foo
2. bar
3. baz
I know that I *could* use 1. for every item, since that's easy enough
to do and Markdown knows what to do when rendering, but that's not so
good for human readers of plain text.
Is there a way I can have vim prefix the lines with an ascending
counter like the above?
c
--
Chris Lott <chris@chrislott.org>
--
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:
Post a Comment