On Mar 13, 8:42 am, parekh  wrote:

> Any recommendations on how I can do this at a command line?

Do you mean a shell prompt, or vim's command line?

If the lines you want to change are contiguous, the visincr script
(from vim.org) works well.

Another approach would be:

    :let n = 0
    :g/reg a0/s/a\zs0/\=n/|s/\[0\]/\='['.n.']'/|let n+=1

I suppose you could use

    vim -c "let n = 0|g/reg a0/s/a\zs0/\=n/|s/\[0\]/\='['.n.']'/|let n
+=1" -c x <file>

to do it all from a shell prompt.

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