I have a file that looks a bit like this
foo
! START
bar1
! END
foo
! START
bar2
! END
foo
Is there a way of yanking text that lives between the lines containing START and END patterns? I.e. to get
bar1
bar2
I know that doing
g/START/+1y
would do it for this exact example, but I'm looking for a solution that copies all lines that are bound between some pattern or a start and end pattern, regardless of how many lines exist between them.
Help! :)
You can use a global command
Explanation