Sunday, January 30, 2011

Re: Delete, add 16, and insert

On 01/30/11 14:26, Adam wrote:
>> What you want is to enter the ^A literally which can be done
>> by prefixing it with control+V:
>
> Oh sorry yeah that's what I did do (^V^A) I guess I left it
> out. When you do that it appears that it's only incrementing
> by 1 though instead of the prefix that you give it (16 in this
> case)

Good then, just wanted to make sure you weren't being surprised
by the behavior...I just tested it with a simple file with rows
of numbers and it worked with the [count] prefix:

:g/^\d/norm 16^A

(with the ^A as described). I also tested against the OP's data
and it worked for me.

Additionally, in my test case (with numbers on each line), you
can just use the :norm command with the range as detailed at

:help :normal-range

and just issue

:%norm 16^A

(if any lines shouldn't be incremented, using a smarter :g
command would be better)

-tim


--
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: