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):
36
#91 - Victor Haffreingue / @nobe_4

04/27/2015 at 06:56AM

36
#92 - niels aamloos / @AamloosNiels

05/28/2016 at 02:00PM

37
#93 - Pete Johns / @johnsyweb

01/23/2011 at 08:46PM

37
#94 - Thom Hughes / @thom_hughes_1

05/04/2011 at 09:20AM

37
#95 - Gurukandhamoorthi / @Gurukandhamoor1

07/17/2017 at 05:36PM

38
#96 - Jonathan / @jdelStrother

02/15/2011 at 06:17PM

38
#97 - Zak Johnson / @zakj

04/22/2011 at 03:09AM

38
#98 - Glen / @Glen_S

07/22/2012 at 09:36AM

38
#99 - Marcin Szamotulski / @me_coot

11/24/2012 at 08:41AM

39
#100 - paul_carey / @paul_carey

01/28/2011 at 10:05AM

39
#101 - Toto l'haricot / @nico_le_terribl

01/29/2011 at 09:18PM

39
#102 - Roy Marco Aruta / @royaruta

02/19/2011 at 04:16PM

39
#103 - Peter Anselmo / @peter_anselmo

06/24/2011 at 03:32PM

39
#104 - Christopher Erin / @MCNormalMode

09/27/2011 at 05:23PM

39
#105 - Ivo Dancet / @caifara

12/03/2011 at 07:57PM

39
#106 - Chris Brown / @engineercyb

08/17/2012 at 12:42AM

39
#107 - cj / @cj01101

08/19/2013 at 10:53PM

40
#108 - Rob Ciaccio / @RobertoCalavera

01/24/2011 at 09:41AM

40
#109 - Rörd Hinrichsen / @roerdhh

01/29/2011 at 03:25AM

40
#110 - Stigius / @Stigius

02/10/2011 at 10:25AM

40
#111 - Julien Pivotto / @roidelapluie

03/15/2011 at 10:41AM

40
#112 - J. Cliff Dyer / @jcdyer

12/12/2011 at 08:31PM

40
#113 - Burkhard Zimmermann / @BurkZimm

12/26/2011 at 05:30PM

40
#114 - Jyun-Fan Tsai / @fakecolor

02/11/2012 at 03:32AM

40
#115 - Lily / @lilibethdlc

03/02/2012 at 06:25AM

40
#116 - angel / @anmaso

04/16/2012 at 10:05PM

40
#117 - Daniel Wallace / @gtmanfred

10/12/2012 at 07:29PM

40
#118 - mnx / @mnxx

11/15/2015 at 05:35PM

40
#119 - anakojm / @anakojm

07/14/2022 at 12:11AM

41
#120 - Steven Occhipinti / @steveocchipinti

02/03/2011 at 03:04AM