Re: Inserting text of arbitrary length before rectangular region
On Thu, 5 Mar 2020 at 21:02, Marc Simpson wrote: > > I'd go the traditional vi route, > > :.,/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: Excellent, Marc. Works perfectly. Thank you!
Re: Inserting text of arbitrary length before rectangular region
Thank you for your explanation, Paul. (I'm quite honoured that more than one of vile's developers have posted replies to this thread.) I don't yet have much more than the rudiments of vile editing mastered so I need to study your alternative. It's not a big deal; I'm just curious to see what vile's potential is, and indeed I'm more interested to see the various workarounds, since they tell me more about vile than a canned solution would. Gerard Lally
Re: Inserting text of arbitrary length before rectangular region
On Thu, Mar 05, 2020 at 05:05:15PM -0500, Paul Fox wrote: > marc wrote: > > On Thu, Mar 5, 2020 at 1:43 PM Paul Fox wrote: > > > > > > 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. > > > > Right; I don't have a good solution for inserting between two columns. > > Maybe we really could use a rectangular insert, that works kind of > like the 'c' command except that instead of overwriting a rectangle, > it first opens a rectangle of exactly the right width. > > (Hmmm. I wonder what I did with that compiler. I used to have one > around here somewhere... Heck, I don't think I have a recent vile > source tree.) I do (along with about 90 other source-trees and a few hundred git clones). Not that I'm uninterested (rectangles come up occasionally), but I'm more interested in fixing winvile with Windows 10 :-( At the moment I'm working on xterm, thinking that I might squeeze in some development on winvile before putting out another fire :-) -- Thomas E. Dickey https://invisible-island.net ftp://ftp.invisible-island.net signature.asc Description: PGP signature
Re: Inserting text of arbitrary length before rectangular region
marc wrote: > On Thu, Mar 5, 2020 at 1:43 PM Paul Fox wrote: > > > > 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. > > Right; I don't have a good solution for inserting between two columns. Maybe we really could use a rectangular insert, that works kind of like the 'c' command except that instead of overwriting a rectangle, it first opens a rectangle of exactly the right width. (Hmmm. I wonder what I did with that compiler. I used to have one around here somewhere... Heck, I don't think I have a recent vile source tree.) paul =-- paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 44.8 degrees)
Re: Inserting text of arbitrary length before rectangular region
On Thu, Mar 5, 2020 at 1:43 PM Paul Fox wrote: > > 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. Right; I don't have a good solution for inserting between two columns. /M
Re: Inserting text of arbitrary length before rectangular region
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 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, p...@foxharp.boston.ma.us (arlington, ma, where it's 45.7 > > degrees) > > > > > =-- paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 45.5 degrees)
Re: Inserting text of arbitrary length before rectangular region
I'd go the traditional vi route, :.,/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 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, p...@foxharp.boston.ma.us (arlington, ma, where it's 45.7 degrees) > >
Re: Inserting text of arbitrary length before rectangular region
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, p...@foxharp.boston.ma.us (arlington, ma, where it's 45.7 degrees)