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 5f316d5c8d826b000640670e

C to python code snippet

C code can be easily translated into Python code. However, the difference in syntax can make this process tedious and time-consuming. Can Vim help you here?

Start file
const wc_units_data wc_units_frequency[]=
{
    {"mHz", 1e-3},
    {"Hz", 1.0},
    {"kHz", 1e3},
    {"MHz", 1e6},
    {"GHz", 1e9},
    {NULL,0}
};
End file
def wc_units_frequency():
    return {"mHz": 1e-3,
            "Hz": 1.0,
            "kHz": 1e3,
            "MHz": 1e6,
            "GHz": 1e9,
            "NULL": 0}

View Diff

1,9c1,7
< const wc_units_data wc_units_frequency[]=
< {
<     {"mHz", 1e-3},
<     {"Hz", 1.0},
<     {"kHz", 1e3},
<     {"MHz", 1e6},
<     {"GHz", 1e9},
<     {NULL,0}
< };
---
> def wc_units_frequency():
>     return {"mHz": 1e-3,
>             "Hz": 1.0,
>             "kHz": 1e3,
>             "MHz": 1e6,
>             "GHz": 1e9,
>             "NULL": 0}

Solutions by @quemeraisc:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @Seve_py

30 active golfers, 88 entries

Solutions by @quemeraisc:
48
#2 - quemeraisc / @quemeraisc

05/06/2022 at 03:03PM

50
#>10 - quemeraisc / @quemeraisc

05/06/2022 at 02:51PM

53
#>13 - quemeraisc / @quemeraisc

05/06/2022 at 02:26PM

63
#>16 - quemeraisc / @quemeraisc

05/06/2022 at 02:13PM

66
#>16 - quemeraisc / @quemeraisc

05/06/2022 at 02:03PM

69
#>17 - quemeraisc / @quemeraisc

05/06/2022 at 09:41AM

77
#>20 - quemeraisc / @quemeraisc

05/06/2022 at 09:16AM