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 4d3c51f1aabf526ed6000030

HTML to Haml

Help convert this HTML page to Haml.

Start file
<html>
  <head>
    <title>Vim Rocks!</title>
  </head>
  <body>
    <h1>So does Haml</h1>
  </body>
</html>
End file
%html
  %head
    %title Vim Rocks!
  %body
    %h1 So does Haml

View Diff

1,8c1,5
< <html>
<   <head>
<     <title>Vim Rocks!</title>
<   </head>
<   <body>
<     <h1>So does Haml</h1>
<   </body>
< </html>
---
> %html
>   %head
>     %title Vim Rocks!
>   %body
>     %h1 So does Haml

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 178 remaining solutions by signing in and submitting your own entry
#179 luffy / @raxcoi - Score: 141 - 06/12/15 @ 04:14
:%s#</.*>#<CR>:%s/<\zs.*\ze>/%&<CR>u:<Up><Left><Left>\<CR>u:<Up><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS><Left>\v<Right>(.*)<Right><Right><Right><BS><CR>uu<C-R>:<Up><BS>\1<CR>u:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><BS><BS><CR>:%s/</%<CR>:%s/>/ /<CR>:g/^$/d<CR>:<Up><Left><Left><Left> *<CR>:$<BS>%s/\s*$/<CR>ZZ

0 comments


Created by: @bradly

179 active golfers, 706 entries

Leaderboard (lowest score wins):
39
#91 - Ivo Dancet / @caifara

12/03/2011 at 07:57PM

39
#92 - Chris Brown / @engineercyb

08/17/2012 at 12:42AM

39
#93 - cj / @cj01101

08/19/2013 at 10:53PM

40
#94 - Rob Ciaccio / @RobertoCalavera

01/24/2011 at 09:41AM

40
#95 - Rörd Hinrichsen / @roerdhh

01/29/2011 at 03:25AM

40
#96 - Stigius / @Stigius

02/10/2011 at 10:25AM

40
#97 - Julien Pivotto / @roidelapluie

03/15/2011 at 10:41AM

40
#98 - J. Cliff Dyer / @jcdyer

12/12/2011 at 08:31PM

40
#99 - Burkhard Zimmermann / @BurkZimm

12/26/2011 at 05:30PM

40
#100 - Jyun-Fan Tsai / @fakecolor

02/11/2012 at 03:32AM

40
#101 - Lily / @lilibethdlc

03/02/2012 at 06:25AM

40
#102 - angel / @anmaso

04/16/2012 at 10:05PM

40
#103 - Daniel Wallace / @gtmanfred

10/12/2012 at 07:29PM

40
#104 - mnx / @mnxx

11/15/2015 at 05:35PM

41
#105 - Steven Occhipinti / @steveocchipinti

02/03/2011 at 03:04AM

41
#106 - Jouko Karvonen / @joukokar

02/03/2011 at 05:24AM

41
#107 - 無ん垢の叫び / @john_ababa

05/26/2012 at 02:49AM

41
#108 - J. Nick Terry / @deft_code

08/28/2012 at 06:17PM

41
#109 - Bill Booth / @ohiopyle

01/29/2014 at 07:42AM

42
#110 - Bradly Feeley / @bradly

01/23/2011 at 06:03PM

42
#111 - Michał Taszycki / @mehowte

01/24/2011 at 10:28AM

42
#112 - Esa-Matti Suuronen / @EsaMatti

04/25/2011 at 10:16AM

42
#113 - nona urbiz / @nospampleasemam

09/29/2013 at 09:07AM

42
#114 - david ta / @tadavid

11/20/2013 at 11:27PM

42
#115 - Daniel / @Daniel00288663

04/03/2017 at 07:37AM

43
#116 - Thomas Schönwälder / @Masei1988

01/23/2011 at 05:07PM

43
#117 - François Marais / @maraisf

04/05/2018 at 07:13PM

44
#118 - Joost / @vlabakje

02/12/2011 at 04:01PM

44
#119 - Sid Kasivajhula / @CountVajhula

02/17/2011 at 08:29AM

44
#120 - Dave / @zzdave13

07/21/2011 at 09:02PM