Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5ea82da50a8bcc00091923e4

Reconstruct the actual output from my unit test tool report

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

Start file
  {'claims': [{'add': '',
-              'mainsnak': {'property': 'P31',
+              'mainsnak': {'datatype': 'wikibase-item',
+                           'datavalue': {'type': 'wikibase-entityid',
+                                         'value': {'entity-type': 'item',
+                                                   'id': 'Q5',
+                                                   'numeric-id': 5}},
+                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
+                           'property': 'P31',
-                           'snaktype': 'value',
+                           'snaktype': 'value'},
?                                              +

-                           'value': {'entity-type': 'item', 'id': 'Q5'}},
+              'qualifiers': {},
               'rank': 'normal',
               'type': 'statement'}],
   'id': 'Q44',
   'ns': 0}
End file
{'claims': [{'add': '',
             'mainsnak': {'datatype': 'wikibase-item',
                          'datavalue': {'type': 'wikibase-entityid',
                                        'value': {'entity-type': 'item',
                                                  'id': 'Q5',
                                                  'numeric-id': 5}},
                          'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
                          'property': 'P31',
                          'snaktype': 'value'},

             'qualifiers': {},
             'rank': 'normal',
             'type': 'statement'}],
 'id': 'Q44',
 'ns': 0}

View Diff

1,12c1,9
<   {'claims': [{'add': '',
< -              'mainsnak': {'property': 'P31',
< +              'mainsnak': {'datatype': 'wikibase-item',
< +                           'datavalue': {'type': 'wikibase-entityid',
< +                                         'value': {'entity-type': 'item',
< +                                                   'id': 'Q5',
< +                                                   'numeric-id': 5}},
< +                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
< +                           'property': 'P31',
< -                           'snaktype': 'value',
< +                           'snaktype': 'value'},
< ?                                              +
---
> {'claims': [{'add': '',
>              'mainsnak': {'datatype': 'wikibase-item',
>                           'datavalue': {'type': 'wikibase-entityid',
>                                         'value': {'entity-type': 'item',
>                                                   'id': 'Q5',
>                                                   'numeric-id': 5}},
>                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
>                           'property': 'P31',
>                           'snaktype': 'value'},
14,19c11,15
< -                           'value': {'entity-type': 'item', 'id': 'Q5'}},
< +              'qualifiers': {},
<                'rank': 'normal',
<                'type': 'statement'}],
<    'id': 'Q44',
<    'ns': 0}
---
>              'qualifiers': {},
>              'rank': 'normal',
>              'type': 'statement'}],
>  'id': 'Q44',
>  'ns': 0}

Solutions by @dstein64:

Unlock 3 remaining solutions by signing in and submitting your own entry
Created by: @Yes_I_Know_IT

52 active golfers, 152 entries

Solutions by @dstein64:
16
#12 - Dan / @dstein64

05/04/2020 at 08:41PM

17
#>33 - Dan / @dstein64

05/04/2020 at 08:40PM

18
#>39 - Dan / @dstein64

05/04/2020 at 08:39PM