Re: multi line regex's in vi ...

2000-05-01 Thread John Forest
On Sat, Apr 29, 2000 at 08:13:21PM -0700, Rick Younie wrote: On Sat, Apr 29, 2000, Adam Shand wrote: A two-liner is %s/^/p/ - add p to the start of each line %s/^p$// - remove any lines that contain only p nope won't work. it'll put a 'p ' at the beginning of every line which

Re: multi line regex's in vi ...

2000-05-01 Thread Adam Shand
that's useful, thanks. i've never used macro's in vi, i'll play with it. i need to check out wml as well as someone else suggested ;) adam. On Sat, 29 Apr 2000, Rick Younie wrote: On Sat, Apr 29, 2000, Adam Shand wrote: A two-liner is %s/^/p/ - add p to the start of each line

Re: multi line regex's in vi ...

2000-05-01 Thread Adam Shand
I'm no pro, but the following, without squashing works. And yes, I know that at the end of the file it might give an error. :g/^ *$/+1 s/^ *[^ ]/p/ that does indeed do the trick! now i just have to decipher the regex so i understand it. thanks! adam.

Re: multi line regex's in vi ...

2000-05-01 Thread w trillich
Adam Shand wrote: clever solution. wish i'd come up with that one. ain't that always the way ... :) here's the lo-down: :g - globally--i.e. thru every line in the file how is that different from :s/find/replace/g ? ex is a LINE editor. if your line looks like this:

Re: multi line regex's in vi ...

2000-04-30 Thread Adam Shand
So add p to any non-blank line? I'd like to know a one-liner for this too. You've got blank line with ^$ but how do you negate that? but what if a paragraph has more then one line. you have to detect the beginning of a new paragraph and then insert a 'p ' before the first line of text. A

Re: multi line regex's in vi ...

2000-04-30 Thread Rick Younie
On Sat, Apr 29, 2000, Adam Shand wrote: A two-liner is %s/^/p/ - add p to the start of each line %s/^p$// - remove any lines that contain only p nope won't work. it'll put a 'p ' at the beginning of every line which has text in it. thus this: Ah. Don't know how to do that with

Re: multi line regex's in vi ...

2000-04-29 Thread Rick Younie
In article [EMAIL PROTECTED] you wrote: is there a way to match a pattern over more then one line in vi (i normally use vim)? i'm html formatting text documents and what i'd like to do is replace something like the below paragraphs:

Re: multi line regex's in vi ...

2000-04-28 Thread Adam Shand
while you can specify that a substitution take place on many lines (1,3s/// for lines 1-3, .,$s/// for lines here to end of file, or %s/// for lines all) VI is based on EX which is a line editor. yah, hence my question :) there may be some advanced voodoo mumbo-jumbo that will allow VIM (or

Re: multi line regex's in vi ...

2000-04-27 Thread Eric G . Miller
There are several ways in VIM. You can specify ranges (lines, counts) or globally. :%s/x/y/ . See the :help for more info. -- ¶ One·should·only·use·the·ASCII·character­set·when·compos­  » ing·email·messages. 

Re: multi line regex's in vi ...

2000-04-27 Thread w trillich
while you can specify that a substitution take place on many lines (1,3s/// for lines 1-3, .,$s/// for lines here to end of file, or %s/// for lines all) VI is based on EX which is a line editor. there may be some advanced voodoo mumbo-jumbo that will allow VIM (or ELVIS, another enhanced VI) to

multi line regex's in vi ...

2000-04-26 Thread Adam Shand
is there a way to match a pattern over more then one line in vi (i normally use vim)? i'm html formatting text documents and what i'd like to do is replace something like the below paragraphs: __ the first line of text, this is