I have a file that looks like this:
'description': 'US RTS'
'sgv:activationStatus': true
'sgv:assignedSegments': ['segments:16c...
'sgv:created': 2019-09-25T12:31:36.088-04:00
'sgv:createdBy': '203796'
'sgv:lastModified': 2020-08-11T15:19:39.230-04:00
...
I want to remove all the lines that contain 'sgv:' EXCEPT for the ones that also contain 'assignedSegments'. I can do it like this:
:g!/assignedSegments/s/sgv:.*/& DELETE/
:g/DELETE/d
But I think that there may be a more elegant way to do it in a one-liner. Any suggestions?