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

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

47 active golfers, 126 entries

Solutions by @GavinKoeng:
34
#11 - Gavin / @GavinKoeng

03/16/2026 at 02:13PM

35
#>15 - Gavin / @GavinKoeng

03/16/2026 at 02:12PM

36
#>21 - Gavin / @GavinKoeng

03/16/2026 at 02:12PM

37
#>25 - Gavin / @GavinKoeng

03/16/2026 at 02:11PM

38
#>38 - Gavin / @GavinKoeng

03/16/2026 at 02:10PM

42
#>40 - Gavin / @GavinKoeng

03/16/2026 at 02:08PM

49
#>46 - Gavin / @GavinKoeng

03/16/2026 at 02:04PM

49
#>46 - Gavin / @GavinKoeng

03/16/2026 at 02:05PM

52
#>47 - Gavin / @GavinKoeng

03/16/2026 at 02:02PM

59
#>47 - Gavin / @GavinKoeng

03/16/2026 at 01:59PM