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 58860440c57fb30006000004

Extract HTML option values from tag values

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

Start file
<select>
  <option>Volvo</option>
  <option>Aston Martin</option>
  <option>Audi</option>
  <option>Alfa Romeo</option>
</select>
End file
<select>
  <option value="volvo">Volvo</option>
  <option value="aston_martin">Aston Martin</option>
  <option value="audi">Audi</option>
  <option value="alfa_romeo">Alfa Romeo</option>
</select>

View Diff

2,5c2,5
<   <option>Volvo</option>
<   <option>Aston Martin</option>
<   <option>Audi</option>
<   <option>Alfa Romeo</option>
---
>   <option value="volvo">Volvo</option>
>   <option value="aston_martin">Aston Martin</option>
>   <option value="audi">Audi</option>
>   <option value="alfa_romeo">Alfa Romeo</option>

Solutions by @AyayaMoh:

Unlock 5 remaining solutions by signing in and submitting your own entry
Created by: @kevgathuku

42 active golfers, 98 entries

Solutions by @AyayaMoh:
35
#10 - moh ayaya / @AyayaMoh

09/26/2023 at 05:16PM

36
#>17 - moh ayaya / @AyayaMoh

09/26/2023 at 05:14PM

37
#>21 - moh ayaya / @AyayaMoh

09/26/2023 at 05:11PM

38
#>34 - moh ayaya / @AyayaMoh

09/26/2023 at 05:09PM

43
#>37 - moh ayaya / @AyayaMoh

09/26/2023 at 04:26PM