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

189 active golfers, 758 entries

Leaderboard (lowest score wins):
48
#151 - Marchand Paul-Valère / @pvmarch

02/28/2014 at 08:09PM

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

01/24/2011 at 06:28PM

49
#153 - TchiKong / @tchikong

01/29/2011 at 12:10PM

49
#154 - Pavlo Klets / @p01nt

02/04/2011 at 11:54AM

49
#155 - xaizek / @xaizek

02/26/2011 at 11:58AM

49
#156 - Adam / @djthread

04/14/2011 at 04:54PM

49
#157 - Jonathan Payne / @JonathanPayne4

11/03/2011 at 05:21PM

49
#158 - Jakub Arnold / @darthdeus

12/19/2011 at 04:10PM

50
#159 - Brandon Ferguson / @bnferguson

01/24/2011 at 06:12PM

50
#160 - Florian Vallen / @florianvallen

02/05/2011 at 08:16PM

50
#161 - Justin Knag / @justinknag

08/28/2014 at 11:22AM

50
#162 - Alexander Kazakov / @volandkot

04/03/2015 at 01:40PM

51
#163 - Arto Vuori / @dhpe

09/01/2012 at 05:17PM

51
#164 - Jurica / @Jurica34581259

12/05/2018 at 02:59AM

52
#165 - brett / @brettyukich

09/22/2013 at 02:21PM

53
#166 - Nomen Nescio / @vadtusan

04/13/2011 at 11:31AM

53
#167 - Ben Wagaman / @jamin4jc

01/13/2012 at 06:23AM

53
#168 - CHIP CASTLE / @chipcastle

12/28/2013 at 03:17AM

53
#169 - Felipe Jaramillo F / @mrfelipe

04/11/2014 at 11:54PM

54
#170 - Vernon Thommeret / @synotic

01/30/2011 at 06:34AM

55
#171 - Franco Lazzarino / @flazz

01/29/2011 at 01:55AM

55
#172 - tdirrenb / @tdirrenb

05/14/2011 at 05:45PM

55
#173 - Golf Sinteppadon / @minigolf2000

04/25/2012 at 06:16PM

56
#174 - Matthieu Honel / @ocus

01/26/2011 at 09:00PM

56
#175 - abonec / @abonec

04/30/2012 at 11:19AM

57
#176 - JR Boyens / @jboyens

01/24/2011 at 06:56PM

57
#177 - Tallak Tveide / @tallakt

10/18/2012 at 02:20PM

58
#178 - Jon Allured / @jonallured

09/14/2011 at 01:09AM

62
#179 - Dmitry Teslenko / @krab_mozga

01/25/2011 at 09:43AM

64
#180 - Cam Peterson / @Cam_Peterson

03/30/2011 at 12:53AM