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 54a480bb5db1600002939b54

increment by column in XML

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

Start file
<root>
  <row>
    <alpha>mail</alpha>
    <bravo>@@@@@</bravo>
  </row>
  <row>
    <alpha>male</alpha>
    <bravo>@@@@@</bravo>
  </row>
  <row>
    <alpha>mayel</alpha>
    <bravo>@@@@@</bravo>
  </row>
  <row>
    <alpha>mahel</alpha>
    <bravo>@@@@@</bravo>
  </row>
</root>
End file
<root>
  <row>
    <alpha>mail</alpha>
    <bravo>10000</bravo>
  </row>
  <row>
    <alpha>male</alpha>
    <bravo>10001</bravo>
  </row>
  <row>
    <alpha>mayel</alpha>
    <bravo>10002</bravo>
  </row>
  <row>
    <alpha>mahel</alpha>
    <bravo>10003</bravo>
  </row>
</root>

View Diff

@@ -1,18 +1,18 @@
 <root>
   <row>
     <alpha>mail</alpha>
-    <bravo>@@@@@</bravo>
+    <bravo>10000</bravo>
   </row>
   <row>
     <alpha>male</alpha>
-    <bravo>@@@@@</bravo>
+    <bravo>10001</bravo>
   </row>
   <row>
     <alpha>mayel</alpha>
-    <bravo>@@@@@</bravo>
+    <bravo>10002</bravo>
   </row>
   <row>
     <alpha>mahel</alpha>
-    <bravo>@@@@@</bravo>
+    <bravo>10003</bravo>
   </row>
-</root>
+</root>
\ No newline at end of file

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 39 remaining solutions by signing in and submitting your own entry
#40 Daniel / Daniel00288663 - Score: 27 - 04/06/17 @ 13:55
/@<CR>R10000<Esc>qqyawnv4lp<C-A>q2@qZZ

0 comments


#41 Jacob Buete / JBuete - Score: 27 - 07/04/17 @ 12:25
:%s/@@@@@/10000<CR>3<C-A>4k2<C-A>4k<C-A>ZZ

0 comments


#42 Grisha Pushkov / readoonly - Score: 28 - 01/01/15 @ 18:08
i4<Esc>xqq?@<CR>p5hr1l4r0x<C-X>ylq3@qZZ

0 comments


#43 Lieven Keersmaekers / LievenKeersmaek - Score: 29 - 01/03/15 @ 11:53
:%s;@\+;\=line('.')/<k4>+<k9><k9><k9><k9><CR>ZZ

0 comments


#44 Raynard, Jordan / raynard_jordan - Score: 31 - 01/15/15 @ 02:51
:%s/@/1<CR>:<Up><BS>0/g<CR>8k4wh<C-A>4j<C-A><C-A>4j3<C-A>ZZ

0 comments


#45 Gurukandhamoorthi / Gurukandhamoor1 - Score: 31 - 08/20/17 @ 14:50
qq/#<BS>@<CR>cit10000<Esc>q3@q3<C-A>4k2<C-A>4k<C-A>ZZ

0 comments


#46 ɐʇnɥsɐpoʇ / todashuta - Score: 32 - 03/26/15 @ 06:35
:%s/@@@@@/10000/g<CR>3<C-A>/\d<<CR>n<C-A>n2<C-A>ZZ

0 comments


#47 Mauro Persano / fzort - Score: 44 - 06/05/15 @ 23:14
/@<CR>ct<10000<Esc>nct<10001<Esc>nct<10002<Esc>nct<10003<Esc>ZZ

0 comments


#48 Formally Dallin / FormallyDallin - Score: 46 - 03/24/15 @ 21:54
:%s/@@@@@/10000/g<CR><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>r3<Up><Up><Up><Up>r2<Up><Up><Up><Up>1r1ZZ

0 comments


#49 luffy / raxcoi - Score: 49 - 01/08/15 @ 11:07
:let @a=10000|%s/@@@@@/\=@a+setreg('a', @a+1)/<CR>ZZ

0 comments


Created by: dreftymac

49 active golfers, 138 entries

Leaderboard (lowest score wins):
19
#1 - Jon Krause / jkrause314

01/20/2016 at 10:42PM

19
#2 - Turkey Man / lvturkeyman

12/07/2017 at 03:14AM

19
#3 - vimthrowaway / vimgolf_throw

04/08/2018 at 11:23AM

19
#4 - DHM / DHM29978992

05/29/2018 at 03:04AM

20
#5 - Urtica dioica / udioica

01/01/2015 at 07:54AM

20
#6 - Petro Тrouq / zulolosi

01/01/2015 at 11:15AM

20
#7 - Kai Yuan / kentyuan

01/01/2015 at 08:55PM

20
#8 - Pavlo Klets / p01nt

01/01/2015 at 10:43PM

20
#9 - Jake Eskel / JakeEskel

01/02/2015 at 04:46AM

20
#10 - John Braxler / braxler

01/02/2015 at 02:15PM

20
#11 - Maximiliano Padulo / mpadulo

01/02/2015 at 08:59PM

20
#12 - Piotr G. / gbdlin

01/03/2015 at 04:14PM

20
#13 - Jordana Lachow / TomofBedlam

01/04/2015 at 02:40AM

20
#14 - kimber gonzalez / kimberlycreates

01/07/2015 at 03:07PM

20
#15 - kobby / _kafdot_

01/13/2015 at 11:05PM

20
#16 - Charles H. Leggett / cleggett

01/15/2015 at 01:33PM

20
#17 - Carlos A Henríquez Q / lagunex

01/16/2015 at 05:47PM

20
#18 - mark0829 / mark0829

01/25/2015 at 01:17PM

20
#19 - pftb12345 / pftb12345

04/09/2015 at 02:14PM

20
#20 - Joey / joeyism101

09/11/2015 at 02:10AM

20
#21 - Walker Boh / walker_boh

10/16/2015 at 10:46AM

21
#22 - Matthieu Crapet / mcr05

01/01/2015 at 01:37PM

21
#23 - xieyh11 / xieyh11

02/26/2015 at 09:39AM

22
#24 - YAMADA Yukimi / edp02

01/01/2015 at 08:46AM

22
#25 - mnx / mnxx

01/02/2015 at 08:43AM

22
#26 - .さとうにるぽ引退.swp / nillpo

01/05/2015 at 06:38AM

24
#27 - Michi Loro / michiloro

01/02/2015 at 07:42AM

25
#28 - Robbie Clarken / robbieclarken

01/02/2015 at 03:50AM

25
#29 - )ouni|(antola / jouni_kantola

01/28/2015 at 04:26PM

26
#30 - Eric Biven / EricBiven

12/31/2014 at 11:56PM