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

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

44 active golfers, 110 entries

Solutions by @nickandbro:
34
#10 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

35
#>13 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

36
#>19 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

37
#>23 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

38
#>36 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

39
#>37 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

41
#>38 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

43
#>39 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

44
#>40 - nickGPT / @nickandbro

08/28/2024 at 02:56AM

45
#>43 - nickGPT / @nickandbro

08/28/2024 at 02:55AM

52
#>44 - nickGPT / @nickandbro

08/28/2024 at 02:55AM