[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: quickest way to insert decimal sequence of numbers
From:       Neil Zanella <nzanella () cs ! mun ! ca>
Date:       2003-12-10 4:56:47
[Download RAW message or body]


Thank you for your reply,

I found the CTRL-A feature extremely interesting and useful.
Where did you find it, or rather, how did you come across it?
Is there a similar command for decrementing an integer by one,
perhaps even going down to negative integers after hitting zero?

Thanks!

Neil

On Tue, 2 Dec 2003, Arun Easi wrote:

> lotta ways, some are:
> 1) :let i=1|while i<=14|pu =i|let i=i+1|endwhile
> 
> similar to above, but if you want cursor at 1 do,
> 2) :let i=14|while i|pu! =i|let i=i-1|endwhile
> 
> if you want to use the record functionality
> 3) i1<esc>qqyyp<c-a>q12@q
> where <esc> is actual escape (^[) and <c-a> is ctrl-a
> 
> rgds,
> -Arun
> 
> On Tue, 2 Dec 2003, Neil Zanella wrote:
> 
> >
> > Hello,
> >
> > I would like to know about a convenient way to enter a sequence
> > of consecutive integers such as the following in vim could be.
> > For instance, is there a handy way of comining the vim record
> > command with some sort of increment variable command?
> >
> > Thanks,
> >
> > Neil
> >
> > 1
> > 2
> > 3
> > 4
> > 5
> > 6
> > 7
> > 8
> > 9
> > 10
> > 11
> > 12
> > 13
> > 14
> >
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic