Saturday, April 2, 2011

Re: How to inseart increasing numbers in some columns?

Hi,
You can select those lines, where you want insert. Use following command for your example.

:'<,'>s/$/\="[".line('.')."]"/ 



On Sun, Apr 3, 2011 at 6:06 AM, yanzhisheng <yanzhisheng@yahoo.com.cn> wrote:
hi,
the visual block mode can be applied where the same text are required for all the lines. but, now i want to inseart different text, i.e., increasing number for different lines. what should I do?
what I what is to inseart the following texts:
 
a[1];
a[2];
a[3];
a[4];
a[5];
a[6];
a[7];
a[8];

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

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