Wednesday, July 2, 2014

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

On 2014-07-02 07:47, Tim Chase wrote:
> On 2014-07-02 20:31, Arup Rakshit wrote:
> >   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
>
> Dr. Chip's "VisIncr" script is the go-to for what you describe:
>
> http://vim.sourceforge.net/scripts/script.php?script_id=670

Alternatively, for a one-off, you can visually select the lines do:

:'<,'>s/\d\+/\=line('.')+1-line("'<")

which assumes that the lines are contiguous.

-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

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

Post a Comment