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

175 active golfers, 665 entries

Leaderboard (lowest score wins):
23
#1 - Tim Chase / @gumnos

06/03/2012 at 12:29AM

23
#2 - Kerson Hsiao / @KersonHsiao

08/07/2012 at 03:44PM

23
#3 - Urtica dioica / @udioica

12/11/2012 at 01:32AM

23
#4 - Petro Тrouq / @zulolosi

06/04/2013 at 08:22PM

23
#5 - Bradd Szonye / @bszonye

07/15/2013 at 02:52AM

23
#6 - John Braxler / @braxler

04/21/2014 at 02:42PM

23
#7 - kimber gonzalez / @kimberlycreates

01/22/2015 at 03:25PM

23
#8 - Jon Krause / @jkrause314

01/26/2016 at 06:04PM

24
#9 - Saki Gw / @Sakigw

02/05/2017 at 07:19PM

24
#10 - sijinyuan / @sijinyuan

03/23/2017 at 01:33AM

24
#11 - Turkey Man / @lvturkeyman

11/25/2017 at 08:18AM

24
#12 - DHM / @DHM29978992

04/30/2018 at 07:11PM

26
#13 - jimauthors / @jimauthors

02/14/2014 at 01:17AM

27
#14 - Federico Galassi / @federicogalassi

01/25/2011 at 10:04PM

27
#15 - Stephen Morrow / @yawmark

01/26/2011 at 02:35AM

27
#16 - Wei Dai / @clvv42

01/28/2011 at 06:29AM

27
#17 - Ujjwol Lamichhane / @Ujjwol

02/03/2011 at 03:01AM

27
#18 - Andrew Dorman / @andydorman

02/16/2011 at 04:37PM

27
#19 - bluewookie / @bluewookie

02/21/2011 at 11:36PM

27
#20 - vg / @vimgolfer

03/04/2011 at 02:19PM

27
#21 - Wesley Beary / @geemus

04/05/2011 at 01:05AM

27
#22 - Dragan Cvetinovic / @kawkafi

05/10/2011 at 10:29PM

27
#23 - (Emile (Swarts)) / @EmileSwarts

06/09/2011 at 07:59PM

27
#24 - not so punk :] / @notsopunk

06/19/2011 at 06:54AM

27
#25 - Robert Robotter / @robrob12

07/20/2011 at 08:59AM

27
#26 - Hu Junfeng / @junfeng

08/01/2011 at 02:16PM

27
#27 - You-Siang Lin / @yslinnctu

11/30/2011 at 07:37AM

27
#28 - Xavier Nayrac / @lkdjiin

01/08/2012 at 11:23AM

27
#29 - Fitz / @Fitzface

01/17/2012 at 10:59PM

27
#30 - Renat Aksitov / @Korvin79

03/03/2012 at 05:56PM