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 50b1d7239aad89000200002d

Extract text from xml

Extract text from xml file (ignoring commented out elements) and create a one line regex.

Start file
<list>
  <item>txt123</item>
  <!-- <item>txt124</item> -->
  <!-- <item>txt126</item> -->
  <item>txt127</item>
  <item>txt137</item>
  <!-- <item>txt145</item> -->
  <item>txt148</item>
  <!-- <item>txt150</item> -->
</list>
End file
^(txt123|txt127|txt137|txt148).*$

View Diff

1,10c1
< <list>
<   <item>txt123</item>
<   <!-- <item>txt124</item> -->
<   <!-- <item>txt126</item> -->
<   <item>txt127</item>
<   <item>txt137</item>
<   <!-- <item>txt145</item> -->
<   <item>txt148</item>
<   <!-- <item>txt150</item> -->
< </list>
---
> ^(txt123|txt127|txt137|txt148).*$

Solutions by @GavinKoeng:

Unlock 15 remaining solutions by signing in and submitting your own entry
Created by: @mhbvim

50 active golfers, 149 entries

Solutions by @GavinKoeng:
28
#8 - Gavin / @GavinKoeng

06/12/2026 at 01:48AM

28
#>8 - Gavin / @GavinKoeng

06/12/2026 at 01:49AM

29
#>11 - Gavin / @GavinKoeng

06/12/2026 at 01:48AM

31
#>13 - Gavin / @GavinKoeng

06/12/2026 at 01:47AM

34
#>15 - Gavin / @GavinKoeng

06/12/2026 at 01:47AM

35
#>19 - Gavin / @GavinKoeng

06/12/2026 at 01:46AM

36
#>21 - Gavin / @GavinKoeng

06/12/2026 at 01:45AM

37
#>23 - Gavin / @GavinKoeng

06/12/2026 at 01:45AM

38
#>26 - Gavin / @GavinKoeng

06/12/2026 at 01:44AM

39
#>29 - Gavin / @GavinKoeng

06/12/2026 at 01:44AM

40
#>30 - Gavin / @GavinKoeng

06/12/2026 at 01:43AM

41
#>32 - Gavin / @GavinKoeng

06/12/2026 at 01:43AM

44
#>33 - Gavin / @GavinKoeng

06/12/2026 at 01:42AM

45
#>36 - Gavin / @GavinKoeng

06/12/2026 at 01:39AM

56
#>41 - Gavin / @GavinKoeng

06/12/2026 at 01:38AM