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 @Smylers2:

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

34 active golfers, 76 entries

Solutions by @Smylers2:
34
#2 - Smylers / @Smylers2

01/23/2017 at 07:43PM

35
#>7 - Smylers / @Smylers2

01/24/2017 at 09:43AM

35
#>7 - Smylers / @Smylers2

01/24/2017 at 09:52AM

35
#>7 - Smylers / @Smylers2

01/24/2017 at 10:28AM

36
#>8 - Smylers / @Smylers2

01/23/2017 at 05:07PM

37
#>12 - Smylers / @Smylers2

01/23/2017 at 02:34PM

38
#>16 - Smylers / @Smylers2

01/23/2017 at 02:31PM

41
#>28 - Smylers / @Smylers2

01/23/2017 at 02:22PM

47
#>33 - Smylers / @Smylers2

01/23/2017 at 05:52PM