On 03/21/12 05:35, Jeri Raye wrote:
Assuming that the interesting part of a block
starts with AAA
end with BBB
Another block interesting block
starts with CCC
end with DDD
And a line that starts with EEE is also interresting
While only getting the details piecemeal, it's a bit hard to give
a best solution. But you can use the "\|" token to separate
matches. Or you can lather/rinse/repeat the indentation phase on
my previous email until all the matches you want are found. So
you can either do
:g/^\(AAA\|CCC\|EEE\)/sil! .;/^\(BBB\|DDD\|FFF\)>
which doesn't pair them unless they're immediately together. So
text like
AAA
CCC
BBB
DDD
will give you unintended results.
Alternatively, just issue them in pairs indenting the ones you want:
:%left
:g/^AAA/sil! .;/BBB/>
:g/^CCC/sil! .;/DDD/>
:g/^EEE/sil! .;/FFF/>
:v/^\s/d
:%left
-tim
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php