> Now I know with this command:
> :g/\(Lesson \d\{1,3}\)\|Abstract\|\(-\)/t$
Depending on the complexity of your document and how whitespace
is treated, you can do most of them pretty easily:
:g/^Lesson \d\+//^Abstract/;/^...@!/t$
This assumes that there are no blank lines between your "-" lines
in your Abstract section. Otherwise, you can do all of them
except the last Lesson with
:g/^Lesson \d\+//^Abstract/;/^Lesson \d\+/-t$
(the very last Lesson/Abstract pair doesn't have another "Lesson"
line after it to determine where it ended, so you'd have to do
the last Abstract by hand; so it will give you an "E16 Invalid
Range" for the last one)
As an aside, I'm not sure why this doesn't work with "," instead
of ";" in the range. I keep getting an "E16 Invalid Range" when
I try
:g/^Lesson \d\+//^Abstract/,/^...@!/-t$
which seems to me as if it should work. Even
:g/^Lesson \d\+//^Abstract/,+1t$
fails even though it makes perfect sense to me. [scratches head]
In case #2 above, the E16 is understandable because it does all
but the last one where the last one is invalid. But in this
case, it should be valid, no?
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---