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):
44
#121 - Dave / @zzdave13

07/21/2011 at 09:02PM

44
#122 - Brian / @wyantb_reader

06/26/2014 at 02:23AM

45
#123 - James Cash / @jamesnvc

05/02/2011 at 02:50PM

45
#124 - Daniel / @dbb0

02/20/2012 at 09:29PM

45
#125 - Yariv / @yarivb

09/07/2014 at 02:07PM

45
#126 - ltn614 / @ltn614

09/24/2015 at 07:38AM

45
#127 - Ryan Marcotte / @ryanjmarcotte

11/24/2016 at 11:34PM

46
#128 - Josh Kenzer / @jkenzer

02/12/2011 at 03:31AM

46
#129 - Joel Taylor / @joelteon_

03/28/2011 at 03:24PM

46
#130 - Christopher Brew / @Seph1rothVII

01/11/2012 at 06:45PM

46
#131 - Edgar Gonzalez / @gonzedge

03/02/2012 at 06:12AM

46
#132 - Ram Tamtam / @ramtamtamtam

06/30/2014 at 02:49PM

46
#133 - James / @Dronak

09/20/2014 at 06:31PM

46
#134 - Evan Coleman / @edc1591

05/04/2015 at 06:45PM

47
#135 - Oleg Roshupkin / @jjjahson

01/23/2011 at 07:23PM

47
#136 - Tom Duijf / @tomduijf

02/12/2011 at 04:03PM

47
#137 - Arthur Hinh / @arthur_hinh

03/27/2011 at 01:50AM

47
#138 - Neal Lindsay / @neall

06/17/2011 at 12:56PM

47
#139 - vimja / @vimja666

10/29/2011 at 09:59AM

48
#140 - aimee / @sermoa

01/23/2011 at 05:42PM

48
#141 - Daniel Lundin / @danielundin

11/29/2011 at 08:02AM

48
#142 - Daniel Jonsson / @DanielJonss

01/17/2013 at 08:17PM

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

02/28/2014 at 08:09PM

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

01/24/2011 at 06:28PM

49
#145 - TchiKong / @tchikong

01/29/2011 at 12:10PM

49
#146 - Pavlo Klets / @p01nt

02/04/2011 at 11:54AM

49
#147 - xaizek / @xaizek

02/26/2011 at 11:58AM

49
#148 - Adam / @djthread

04/14/2011 at 04:54PM

49
#149 - Jonathan Payne / @JonathanPayne4

11/03/2011 at 05:21PM

49
#150 - Jakub Arnold / @darthdeus

12/19/2011 at 04:10PM