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

197 active golfers, 800 entries

Leaderboard (lowest score wins):
41
#121 - Steffen / @Pions90

02/16/2020 at 11:02AM

42
#122 - Bradly Feeley / @bradly

01/23/2011 at 06:03PM

42
#123 - Michał Taszycki / @mehowte

01/24/2011 at 10:28AM

42
#124 - Esa-Matti Suuronen / @EsaMatti

04/25/2011 at 10:16AM

42
#125 - nona urbiz / @nospampleasemam

09/29/2013 at 09:07AM

42
#126 - david ta / @tadavid

11/20/2013 at 11:27PM

42
#127 - Daniel / @Daniel00288663

04/03/2017 at 07:37AM

42
#128 - Chester Yap / @Chest_ErYap

08/03/2019 at 08:23PM

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

01/23/2011 at 05:07PM

43
#130 - François Marais / @maraisf

04/05/2018 at 07:13PM

44
#131 - Joost / @vlabakje

02/12/2011 at 04:01PM

44
#132 - Sid Kasivajhula / @CountVajhula

02/17/2011 at 08:29AM

44
#133 - Dave / @zzdave13

07/21/2011 at 09:02PM

44
#134 - Brian / @wyantb_reader

06/26/2014 at 02:23AM

44
#135 - Scott Atkins / @scottrick49

07/06/2021 at 12:39PM

45
#136 - James Cash / @jamesnvc

05/02/2011 at 02:50PM

45
#137 - Daniel / @dbb0

02/20/2012 at 09:29PM

45
#138 - Yariv / @yarivb

09/07/2014 at 02:07PM

45
#139 - ltn614 / @ltn614

09/24/2015 at 07:38AM

45
#140 - Ryan Marcotte / @ryanjmarcotte

11/24/2016 at 11:34PM

45
#141 - shahanavaz m / @shahanavazm

02/20/2022 at 02:23AM

46
#142 - Josh Kenzer / @jkenzer

02/12/2011 at 03:31AM

46
#143 - Joel Taylor / @joelteon_

03/28/2011 at 03:24PM

46
#144 - Christopher Brew / @Seph1rothVII

01/11/2012 at 06:45PM

46
#145 - Edgar Gonzalez / @gonzedge

03/02/2012 at 06:12AM

46
#146 - Ram Tamtam / @ramtamtamtam

06/30/2014 at 02:49PM

46
#147 - James / @Dronak

09/20/2014 at 06:31PM

46
#148 - Evan Coleman / @edc1591

05/04/2015 at 06:45PM

47
#149 - Oleg Roshupkin / @jjjahson

01/23/2011 at 07:23PM

47
#150 - Tom Duijf / @tomduijf

02/12/2011 at 04:03PM