marc wrote: > I'd go the traditional vi route, Yes, clearly in this case, where the insertion is at the start of a line, that's easiest.
paul > > :.,/Tom/s/^/Name of applicant: > > Or if the range wasn't so straightforwardly expressible, you could > mark the first and last lines first (e.g. ma, mb), then > > :'a,'b/^/Name of applicant: > > /M > > On Thu, Mar 5, 2020 at 8:23 AM Paul Fox <[email protected]> wrote: > > > > gerard wrote: > > > I'm having difficulty understanding rectangular regions. > > > > > > Let's say I want to enter the text "Name of applicant: " at the > > > beginning of each line below: > > > > > > John > > > Henry > > > Mike > > > Tom > > > > > > Positioning the cursor at the first character on line 1, I create a > > > rectangular region with 3q3jq > > > > > > I then do c^S and at the prompt I enter "Name of applicant: " (without > > > quotation marks), but only the first letter N is entered. > > > > > > Have I misunderstood what should happen here? > > > > Your expectations were fine, it just doesn't work that way. It > > probably should, but I must have thought it was too hard at the time. > > > > A rectangular 'c'hange command will only operate _inside_ of the defined > > rectangle -- it can't expand that rectangle. There should really be > > a rectangular 'i'nsert command, to do what you're trying to do. > > > > What I do is first open the rectangle I need, either with ^A-r, or > > simply by shift the lines over, mark a corner with 'ma', then go to > > the far corner to change it with 'c`a'. Or you could sweep it out with > > 'q'. > > If I opened the space too big, I then have to trim it back down. > > Clumsy, I know. > > > > Maybe someone else has a better way. > > > > paul > > =---------------------- > > paul fox, [email protected] (arlington, ma, where it's 45.7 > > degrees) > > > > > =---------------------- paul fox, [email protected] (arlington, ma, where it's 45.5 degrees)
