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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 18 remaining solutions by signing in and submitting your own entry
#19 Benoit Tigeot / Benoit_Tgt - Score: 38 - 06/08/17 @ 17:24
qqjyithi value="<C-R>""<Esc>gui"q3@qf r_kk;.ZZ

0 comments

#20 jack / jack28887741 - Score: 44 - 02/24/17 @ 11:58
qqjyithi value=""<Esc>Pgui"vi":s/\%V /_/e<CR>q3@qZZ

0 comments

#21 Avimgolfer / l718232 - Score: 45 - 01/30/17 @ 16:58
qajyithi value=""<Esc>PvT":s/\%V /_/e<CR>gvgu0q3@aZZ

0 comments

#22 Zhihong Liu / pieapple03 - Score: 45 - 02/05/17 @ 14:26
jqq4wyt<bi value="<C-R>""<Esc>gui"j0q3@q3ktms_<Esc>2jh.ZZ

0 comments

#23 Matt Walsh / wattmalsh - Score: 52 - 02/06/17 @ 02:54
qqj0f>lyithi value=""<Esc>hpvi"uvi":s/\%V /_/g<CR>q@q@@@@ZZ

0 comments

Created by: kevgathuku

23 active golfers, 50 entries

Leaderboard (lowest score wins):
34
#1 - Urtica dioica / udioica

01/23/2017 at 03:36PM

34
#2 - Smylers / Smylers2

01/23/2017 at 07:43PM

34
#3 - Saki Gw / Sakigw

01/24/2017 at 06:04PM

34
#4 - ben eisner / b_eisner

02/09/2017 at 09:06AM

34
#5 - Evgeny`s Kindle / EvgenyKindle

03/19/2017 at 09:31AM

36
#6 - Kai Yuan / kentyuan

01/23/2017 at 02:34PM

37
#7 - tPenguinLTG / tpenguinltg

01/24/2017 at 01:58AM

37
#8 - Jan Bundesmann / ixjab

01/25/2017 at 01:39PM

38
#9 - Cristian Lupașcu / clupasq

01/23/2017 at 02:06PM

38
#10 - ZW / ZW73226885

01/24/2017 at 06:40PM

38
#11 - leslie snipes / imjakerl

01/25/2017 at 05:35AM

38
#12 - Jakob / jajob

01/27/2017 at 08:09AM

38
#13 - Tarcísio Gruppi / txgruppi

01/28/2017 at 11:33PM

38
#14 - Marko / ultrox

01/29/2017 at 10:46AM

38
#15 - Avian Y / y_avian

02/05/2017 at 08:48PM

38
#16 - Benjamin Schindler / beschindler

02/11/2017 at 09:01AM

38
#17 - Daniel / Daniel00288663

03/29/2017 at 08:52AM

38
#18 - chu zui / chuzui7

05/15/2017 at 12:22PM

38
#19 - Benoit Tigeot / Benoit_Tgt

06/08/2017 at 05:24PM

44
#20 - jack / jack28887741

02/24/2017 at 11:58AM

45
#21 - Avimgolfer / l718232

01/30/2017 at 04:58PM

45
#22 - Zhihong Liu / pieapple03

02/05/2017 at 02:26PM

52
#23 - Matt Walsh / wattmalsh

02/06/2017 at 02:54AM