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):
50
#151 - Brandon Ferguson / @bnferguson

01/24/2011 at 06:12PM

50
#152 - Florian Vallen / @florianvallen

02/05/2011 at 08:16PM

50
#153 - Justin Knag / @justinknag

08/28/2014 at 11:22AM

50
#154 - Alexander Kazakov / @volandkot

04/03/2015 at 01:40PM

51
#155 - Arto Vuori / @dhpe

09/01/2012 at 05:17PM

51
#156 - Jurica / @Jurica34581259

12/05/2018 at 02:59AM

52
#157 - brett / @brettyukich

09/22/2013 at 02:21PM

53
#158 - Nomen Nescio / @vadtusan

04/13/2011 at 11:31AM

53
#159 - Ben Wagaman / @jamin4jc

01/13/2012 at 06:23AM

53
#160 - CHIP CASTLE / @chipcastle

12/28/2013 at 03:17AM

53
#161 - Felipe Jaramillo F / @mrfelipe

04/11/2014 at 11:54PM

54
#162 - Vernon Thommeret / @synotic

01/30/2011 at 06:34AM

55
#163 - Franco Lazzarino / @flazz

01/29/2011 at 01:55AM

55
#164 - tdirrenb / @tdirrenb

05/14/2011 at 05:45PM

55
#165 - Golf Sinteppadon / @minigolf2000

04/25/2012 at 06:16PM

56
#166 - Matthieu Honel / @ocus

01/26/2011 at 09:00PM

56
#167 - abonec / @abonec

04/30/2012 at 11:19AM

57
#168 - JR Boyens / @jboyens

01/24/2011 at 06:56PM

57
#169 - Tallak Tveide / @tallakt

10/18/2012 at 02:20PM

58
#170 - Jon Allured / @jonallured

09/14/2011 at 01:09AM

62
#171 - Dmitry Teslenko / @krab_mozga

01/25/2011 at 09:43AM

64
#172 - Cam Peterson / @Cam_Peterson

03/30/2011 at 12:53AM

65
#173 - Andrew K / @HashDefDeath

01/31/2012 at 02:58AM

70
#174 - Reza Lotun / @rlotun

01/30/2011 at 06:36PM

70
#175 - Jakub Okoński / @farnoy

01/25/2012 at 02:12PM

71
#176 - Casey Howard / @caseyhoward

04/08/2011 at 03:38AM

72
#177 - Kornél Lugosi / @Coornail

05/28/2011 at 03:45PM

87
#178 - Kohei Yamamoto / @k_ymmt

01/30/2012 at 01:29PM

132
#179 - Tj / @yrddy

08/19/2014 at 11:34AM

141
#180 - luffy / @raxcoi

06/12/2015 at 04:14AM