An appealing idiom is :g with |.  Inherited from vi, :g can run
multiple
commands.  How about

    :let n = 1
    :g/$/s/^/mv /|s/$/\=printf(' sub%03d',n)/|let n += 1

Makes it easy to choose the start, the increment, and which lines get
numbered.  Also, it's built from simple pieces, thus easy to remember.

Regards, John

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to