Wednesday, July 2, 2014

Re: Vim trick to make all the same numbers to replace by the numbera in ascending order ?

I would try to increment it when copying the line. For example (with the
cursor on the second line of:

describe ".employee_learning" do
let(:user1) { FactoryGirl.create(:user, gender: 'f') }
end

Try 'qqYp<C-a>q5@q'.

- Conner


On Wed, Jul 02, 2014 at 08:31:42PM +0800, Arup Rakshit wrote:
>Hi Suppose,
>
>I have below data :
>
>  describe ".employee_learning" do
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>    let(:user1) { FactoryGirl.create(:user, gender: 'f') }
>  end
>
>Only first line I wrote.. then I did Shift + v, then yanked and then 7p. These many action created the above all similar lines. Now I am looking for a trick, so that I can make all user1(s), in one shot like user1-user7. Hope I am able tell you people about my expectation :-) Is this really possible ? or manually *r* command is the only trick to replace each 1 to 2,3,4 increasing order ?

>Regards,
>Arup Rakshit
>
>--
>--
>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 because you are subscribed to the Google Groups "vim_use" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: