Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2010 18:13:29 -0500
From:      William Bulley <web@umich.edu>
To:        gahn <ipfreak@yahoo.com>
Cc:        freebsd general questions <freebsd-questions@freebsd.org>
Subject:   Re: vi question
Message-ID:  <20100219231329.GB91701@itcom245.staff.itd.umich.edu>

next in thread | raw e-mail | index | archive | help
According to gahn <ipfreak@yahoo.com> on Fri, 02/19/10 at 16:11:
> 
> How could I use vi to repeat a word, say, 100 times in the same
> line, of course with a space in between?

Edit your file: (vi xyz)

On an empty line, enter: i<space>word<space>(esc)

Back up (left arrow) to the front of this line (column zero)

Enter this sequence: 2dw   (the line will disappear)

Enter this sequence: 100P   (voila!)

Regards,

web...

--
William Bulley                     Email: web@umich.edu

72 characters width template ----------------------------------------->|



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100219231329.GB91701>