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):
47
#151 - Arthur Hinh / @arthur_hinh

03/27/2011 at 01:50AM

47
#152 - Neal Lindsay / @neall

06/17/2011 at 12:56PM

47
#153 - vimja / @vimja666

10/29/2011 at 09:59AM

48
#154 - aimee / @sermoa

01/23/2011 at 05:42PM

48
#155 - Daniel Lundin / @danielundin

11/29/2011 at 08:02AM

48
#156 - Daniel Jonsson / @DanielJonss

01/17/2013 at 08:17PM

48
#157 - Marchand Paul-Valère / @pvmarch

02/28/2014 at 08:09PM

49
#158 - Glenn Y. R. / @glenux

01/24/2011 at 06:28PM

49
#159 - TchiKong / @tchikong

01/29/2011 at 12:10PM

49
#160 - Pavlo Klets / @p01nt

02/04/2011 at 11:54AM

49
#161 - xaizek / @xaizek

02/26/2011 at 11:58AM

49
#162 - Adam / @djthread

04/14/2011 at 04:54PM

49
#163 - Jonathan Payne / @JonathanPayne4

11/03/2011 at 05:21PM

49
#164 - Jakub Arnold / @darthdeus

12/19/2011 at 04:10PM

50
#165 - Brandon Ferguson / @bnferguson

01/24/2011 at 06:12PM

50
#166 - Florian Vallen / @florianvallen

02/05/2011 at 08:16PM

50
#167 - Justin Knag / @justinknag

08/28/2014 at 11:22AM

50
#168 - Alexander Kazakov / @volandkot

04/03/2015 at 01:40PM

51
#169 - Arto Vuori / @dhpe

09/01/2012 at 05:17PM

51
#170 - Jurica / @Jurica34581259

12/05/2018 at 02:59AM

52
#171 - brett / @brettyukich

09/22/2013 at 02:21PM

53
#172 - Nomen Nescio / @vadtusan

04/13/2011 at 11:31AM

53
#173 - Ben Wagaman / @jamin4jc

01/13/2012 at 06:23AM

53
#174 - CHIP CASTLE / @chipcastle

12/28/2013 at 03:17AM

53
#175 - Felipe Jaramillo F / @mrfelipe

04/11/2014 at 11:54PM

53
#176 - Sylvain Dangin / @Sylvaner03

06/01/2021 at 02:20PM

54
#177 - Vernon Thommeret / @synotic

01/30/2011 at 06:34AM

55
#178 - Franco Lazzarino / @flazz

01/29/2011 at 01:55AM

55
#179 - tdirrenb / @tdirrenb

05/14/2011 at 05:45PM

55
#180 - Golf Sinteppadon / @minigolf2000

04/25/2012 at 06:16PM