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 5035e5b3838d9e000200006d

Dehamlizing

Change this piece of HAML code back into erb

Start file
%tr
  %td= raw("<%= line1_hello %>")
  %td= raw("<%= line2(world) %>")
  %td= raw("<%= line3_hello %>")
  %td= raw("<%= line4 %>")
  %td= raw("<%= line5_(world) %>")
End file
<tr>
  <td><%= line1_hello %></td>
  <td><%= line2(world) %></td>
  <td><%= line3_hello %></td>
  <td><%= line4 %></td>
  <td><%= line5_(world) %></td>
</tr>

View Diff

1,6c1,7
< %tr
<   %td= raw("<%= line1_hello %>")
<   %td= raw("<%= line2(world) %>")
<   %td= raw("<%= line3_hello %>")
<   %td= raw("<%= line4 %>")
<   %td= raw("<%= line5_(world) %>")
---
> <tr>
>   <td><%= line1_hello %></td>
>   <td><%= line2(world) %></td>
>   <td><%= line3_hello %></td>
>   <td><%= line4 %></td>
>   <td><%= line5_(world) %></td>
> </tr>

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 49 remaining solutions by signing in and submitting your own entry
#50 Suvash Thapaliya / suvash - Score: 48 - 09/05/12 @ 10:14
r<A><Esc>j0qqwr<f=ct<><Esc>f"c$</td><Esc>j0q4@qo<BS><BS></tr><Esc>:wq<CR>

0 comments


#51 Peter Etheryte / Etheryte - Score: 50 - 09/02/12 @ 23:26
:%s:%\(..\).\{,7}:<\1>:|%s:"):</td>:<CR>AA<CR><BS><BS></tr><Esc>ZZ

0 comments


#52 Tyler Breisacher / tbreisacher - Score: 52 - 08/25/12 @ 07:31
:%s-%td= raw("\(.*\)")-<td>\1</td>-<CR>{r<A><Esc>yyGpli/<Esc>ZZ

0 comments


#53 Eric Potter / pottereric - Score: 53 - 05/29/13 @ 13:09
R<tr><Esc>:%s/%td= raw("/<td><CR>:%s/")/<\/td><CR>o<BS><BS></tx<BS>r><Esc>ZZ

0 comments


#54 Eumir Gaspar / corrodedlotus - Score: 55 - 08/23/12 @ 08:25
r<A><Esc>yyGpa/<Esc><Up><Right><C-V>4kr<3l<C-V>4jr>l<C-V>5l4jxgv$A</td><Esc>:%s/")//g<CR>ZZ

0 comments


#55 Domon / Domon - Score: 55 - 09/12/12 @ 02:10
r<A><Esc>:%s/%td= raw("/<td>/g<CR>:%s/")/<\/td>/g<CR>o</tr><Esc>0xxZZ

0 comments


#56 captain_morgan / captain_morgan - Score: 56 - 08/23/12 @ 11:14
:%s/%\(..\).\?\(.*\(<.*\)..\)\?/<\1>\3<\/\1><CR>gg4lDGo<Esc>pZZ

0 comments


#57 DJ LoBraico / pygatea - Score: 60 - 12/11/12 @ 23:09
yyGp2Gf=<C-V>4jf"cw<BS>><Esc>qqf"cw</td><Esc>0jq4@q:%s/%/\<<CR>a/<Esc>A><Esc>ggA><Esc>:wq<CR>

0 comments


#58 Chaos / gbchaosmaster - Score: 64 - 08/26/12 @ 22:16
r<A><Esc>Go<BS><BS></tr><Esc>;:%s/%td= raw("/<td><CR>:%s/")/</td><CR>;:<Up><Left><Left><Left><Left><Left><Right>\<CR>:wq<CR>

0 comments


#59 Heath Ritchie / heathritchie - Score: 64 - 11/13/12 @ 22:46
q/<Esc><Esc><Esc><Esc><Esc>:q<CR>q::q<CR>r<ea><Esc>qqj03xi  <<Esc>ea><Esc>l7xf"c$</td><Esc>q4@qo</tr><Esc><<ZZ

0 comments


#60 Son of Bongo / bpcode - Score: 68 - 08/24/12 @ 16:14
:%s/= raw("/<<CR>u:<Up><BS>><CR>:%s/%t/<t<CR>ggA><Esc>yyGpa/<Esc>:%s/'<BS>")/</td><CR>:<Up><Left><Left><Left><Left>\<End><CR>ZZ

0 comments


#61 Andy L / akleak - Score: 96 - 10/16/12 @ 13:03
C<tr><Esc>:%s/%t/<t/g<BS>g<CR>:<Up><BS><BS><BS><BS><BS><BS><BS>= raw("/>/g<CR>kkkkf"C</td><Esc>j0.u;.j<BS>./"<Esc>C<Esc>u/"<CR>C</td><Esc>n.o</tr><Esc>0xx:wqa<CR>

0 comments


#62 Victor Haffreingue / nobe_4 - Score: 97 - 08/06/15 @ 19:24
jqqf%s<<C-C><C-C>f=ct"><Esc>c<Right>><C-C><C-C>lxf"c$</td><C-C><C-C>j0q4@qo<BS><BS></tr><C-C><C-C>ggs<<C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><C-O><Esc>cgguu<Esc>uki<Right><Left><C-O>w<C-O>0<C-O>$>C<BS><C-C><C-C>ZZ

0 comments


Created by: corrodedlotus

62 active golfers, 155 entries

Leaderboard (lowest score wins):
32
#1 - Kerson Hsiao / KersonHsiao

08/24/2012 at 04:06AM

32
#2 - Urtica dioica / udioica

08/24/2012 at 04:59AM

32
#3 - Victor Ramirez / virako

10/15/2012 at 09:53AM

32
#4 - John Braxler / braxler

05/23/2014 at 03:27PM

32
#5 - Petro Тrouq / zulolosi

01/03/2015 at 11:47AM

34
#6 - Conner McDaniel / connermcd

08/24/2012 at 07:21PM

35
#7 - Justin Love / wondible

08/26/2012 at 03:50AM

35
#8 - Vimeo Tossitaouta / VimeoT

09/04/2012 at 02:06AM

36
#9 - Joonas Pihlajamaa / jokkebk

03/14/2014 at 05:18PM

37
#10 - Tesnorth / Tesnorth

08/23/2012 at 03:27PM

37
#11 - wes / _weslly

08/23/2012 at 04:53PM

37
#12 - deigen / deigen0

08/29/2012 at 08:29AM

37
#13 - while0pass / while0pass

08/31/2012 at 03:18AM

37
#14 - BostX / BostX

09/06/2012 at 03:01PM

37
#15 - 無ん垢の叫び / john_ababa

09/16/2012 at 10:24AM

37
#16 - Édouard M'tou / DouardM

10/08/2012 at 09:45PM

37
#17 - Chasetopher / chasetopherlee

11/02/2012 at 05:15AM

38
#18 - h_east (トロッコ6個) / h_east

08/23/2012 at 08:51AM

38
#19 - vansan / VinceVansan

08/23/2012 at 10:49AM

38
#20 - Aaron Hall / aarontothemax

08/24/2012 at 03:27AM

38
#21 - Chris Brown / engineercyb

08/24/2012 at 03:22PM

38
#22 - Sune Simonsen / sunesimonsen

08/25/2012 at 08:42PM

38
#23 - Matt Robbins / mcrmfc

11/25/2014 at 06:07PM

39
#24 - Marcin Sza / coot_

11/03/2012 at 02:21PM

39
#25 - Tyler / tylerbindon

04/06/2013 at 04:22AM

39
#26 - Mauro Persano / fzort

11/20/2014 at 10:30AM

40
#27 - Tom Sisk / TomSisk

11/08/2012 at 08:35PM

40
#28 - Panupan S. / lionpeal

01/16/2013 at 12:03AM

40
#29 - Trevor Powell / DoomedBunnies

04/16/2013 at 01:50AM

40
#30 - Cristian Lupașcu / clupasq

02/26/2016 at 12:09PM