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 179 remaining solutions by signing in and submitting your own entry
#180 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

180 active golfers, 719 entries

Leaderboard (lowest score wins):
27
#31 - Fitz / @Fitzface

01/17/2012 at 10:59PM

27
#32 - Renat Aksitov / @Korvin79

03/03/2012 at 05:56PM

27
#33 - Trevor Powell / @DoomedBunnies

03/20/2013 at 11:52PM

27
#34 - LC / @leeren

08/11/2014 at 12:00AM

27
#35 - Dimitar Dimitrov / @kurkale6ka

04/13/2016 at 09:35AM

27
#36 - fsj / @FrogzSJ

08/13/2018 at 03:19AM

27
#37 - majo senf / @majo_senf

06/25/2019 at 11:27AM

28
#38 - echarp / @charpmanu

11/10/2011 at 07:42PM

29
#39 - Pei-Lun Lee / @ypcatw

01/07/2012 at 04:04PM

30
#40 - Johan Sveholm / @rymdtjuren

06/23/2011 at 06:26AM

30
#41 - Justin Love / @wondible

09/05/2011 at 02:51PM

30
#42 - Woojung Kim 김우중 / @_kimwz

07/16/2013 at 01:54AM

30
#43 - Quota / @Quotad

02/13/2014 at 09:32AM

30
#44 - Joonas Pihlajamaa / @jokkebk

02/19/2014 at 09:36PM

30
#45 - Mauro Persano / @fzort

11/20/2014 at 01:44PM

30
#46 - Skúli Jóhannsson / @skulibj

06/28/2015 at 09:58PM

30
#47 - churaki / @churaki

01/29/2019 at 10:36AM

31
#48 - h_east (トロッコ6個) / @h_east

01/24/2011 at 01:55PM

31
#49 - Kevin Hamer / @khamer

01/24/2011 at 08:25PM

31
#50 - timhoa / @timhoa

01/24/2011 at 09:46PM

31
#51 - Jon Bettinger / @jonbettinger

01/27/2011 at 02:56AM

31
#52 - niquola / @niquola

01/27/2011 at 11:42PM

31
#53 - Artem Dudarev / @dudarev

01/30/2011 at 06:33PM

31
#54 - iCross / @iCrossOfficial

01/31/2011 at 03:44PM

31
#55 - Jarkko Laine / @jarkko

01/31/2011 at 04:10PM

31
#56 - Ivan Nečas / @iNecas

01/31/2011 at 08:29PM

31
#57 - Karel Vervaeke / @karel1980

02/01/2011 at 03:56PM

31
#58 - Eivind Jahren / @HaskellElephant

02/20/2011 at 09:31PM

31
#59 - Sergey Doroshenko / @dorserg

03/09/2011 at 07:12AM

31
#60 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/16/2011 at 06:20AM