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
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
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.
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:
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
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
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:
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
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·characterset·when·compos
» ing·email·messages.
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
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
11 matches
Mail list logo