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

205 active golfers, 881 entries

Leaderboard (lowest score wins):
31
#61 - timhoa / @timhoa

01/24/2011 at 09:46PM

31
#62 - Jon Bettinger / @jonbettinger

01/27/2011 at 02:56AM

31
#63 - niquola / @niquola

01/27/2011 at 11:42PM

31
#64 - Artem Dudarev / @dudarev

01/30/2011 at 06:33PM

31
#65 - iCross / @iCrossOfficial

01/31/2011 at 03:44PM

31
#66 - Jarkko Laine / @jarkko

01/31/2011 at 04:10PM

31
#67 - Ivan Nečas / @iNecas

01/31/2011 at 08:29PM

31
#68 - Karel Vervaeke / @karel1980

02/01/2011 at 03:56PM

31
#69 - Eivind Jahren / @HaskellElephant

02/20/2011 at 09:31PM

31
#70 - Sergey Doroshenko / @dorserg

03/09/2011 at 07:12AM

31
#71 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/16/2011 at 06:20AM

31
#72 - Kristoffer Roupé / @kitofr

07/29/2011 at 11:20AM

31
#73 - Marco Hinz / @_mhinz_

05/22/2013 at 12:49PM

31
#74 - Amir Kremer / @AmirKremer

09/07/2014 at 02:18PM

32
#75 - Alexander Zolotov / @alex_zolotov

01/26/2011 at 07:03AM

32
#76 - Jason Miller / @Aidenn0

04/12/2011 at 09:50PM

32
#77 - Jacob Vosmaer / @jacobvosmaer

06/04/2012 at 09:28PM

32
#78 - Tyler / @tylerbindon

04/07/2013 at 04:31AM

32
#79 - Paul Draghicescu / @pdragy

05/10/2018 at 11:22PM

33
#80 - Balkoth / @_Balkoth_

01/23/2011 at 07:55PM

33
#81 - xhtmlforum / @xhtmlforum

01/24/2011 at 09:34AM

33
#82 - Chris Rhoden / @chrisrhoden

01/24/2011 at 05:47PM

33
#83 - Paul King / @nrocy

01/25/2011 at 08:37PM

33
#84 - Vasil Sakarov / @vsakarov

01/15/2012 at 07:16PM

33
#85 - Andrew O'Neill / @AndroidOatmeal

03/06/2014 at 07:52PM

33
#86 - RockerZZY / @rocker_zzy

06/09/2020 at 05:51AM

34
#87 - Tien Le / @tienlex

01/25/2011 at 04:44PM

34
#88 - Oliver Christ / @0liverChrist

10/02/2013 at 10:32PM

35
#89 - William Dunand / @wdunand

03/05/2012 at 07:37AM

35
#90 - POSIX / @po6ix

01/10/2022 at 02:48PM