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):
31
#61 - Marco Hinz / @_mhinz_

05/22/2013 at 12:49PM

31
#62 - Amir Kremer / @AmirKremer

09/07/2014 at 02:18PM

32
#63 - Alexander Zolotov / @alex_zolotov

01/26/2011 at 07:03AM

32
#64 - Jason Miller / @Aidenn0

04/12/2011 at 09:50PM

32
#65 - Jacob Vosmaer / @jacobvosmaer

06/04/2012 at 09:28PM

32
#66 - Tyler / @tylerbindon

04/07/2013 at 04:31AM

32
#67 - Paul Draghicescu / @pdragy

05/10/2018 at 11:22PM

33
#68 - Balkoth / @_Balkoth_

01/23/2011 at 07:55PM

33
#69 - xhtmlforum / @xhtmlforum

01/24/2011 at 09:34AM

33
#70 - Chris Rhoden / @chrisrhoden

01/24/2011 at 05:47PM

33
#71 - Paul King / @nrocy

01/25/2011 at 08:37PM

33
#72 - Vasil Sakarov / @vsakarov

01/15/2012 at 07:16PM

33
#73 - Andrew O'Neill / @AndroidOatmeal

03/06/2014 at 07:52PM

34
#74 - Tien Le / @tienlex

01/25/2011 at 04:44PM

34
#75 - Oliver Christ / @0liverChrist

10/02/2013 at 10:32PM

35
#76 - William Dunand / @wdunand

03/05/2012 at 07:37AM

36
#77 - Victor Haffreingue / @nobe_4

04/27/2015 at 06:56AM

36
#78 - niels aamloos / @AamloosNiels

05/28/2016 at 02:00PM

37
#79 - Pete Johns / @johnsyweb

01/23/2011 at 08:46PM

37
#80 - Thom Hughes / @thom_hughes_1

05/04/2011 at 09:20AM

37
#81 - Gurukandhamoorthi / @Gurukandhamoor1

07/17/2017 at 05:36PM

38
#82 - Jonathan / @jdelStrother

02/15/2011 at 06:17PM

38
#83 - Zak Johnson / @zakj

04/22/2011 at 03:09AM

38
#84 - Glen / @Glen_S

07/22/2012 at 09:36AM

38
#85 - Marcin Sza / @coot_

11/24/2012 at 08:41AM

39
#86 - paul_carey / @paul_carey

01/28/2011 at 10:05AM

39
#87 - Toto l'haricot / @nico_le_terribl

01/29/2011 at 09:18PM

39
#88 - Roy Marco Aruta / @royaruta

02/19/2011 at 04:16PM

39
#89 - Peter Anselmo / @peter_anselmo

06/24/2011 at 03:32PM

39
#90 - Christopher Erin / @MCNormalMode

09/27/2011 at 05:23PM