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 4fbf8e303be58b0001000024

Format the output

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

Start file
{Vertex('x'): {Vertex('v'): Edge(Vertex('v'), Vertex('x')), Vertex('z'): Edge(Vertex('z'), Vertex('x')), Vertex('y'): Edge(Vertex('y'), Vertex('x'))}, Vertex('y'): {Vertex('x'): Edge(Vertex('y'), Vertex('x')), Vertex('w'): Edge(Vertex('w'), Vertex('y')), Vertex('z'): Edge(Vertex('z'), Vertex('y'))}, Vertex('z'): {Vertex('x'): Edge(Vertex('z'), Vertex('x')), Vertex('y'): Edge(Vertex('z'), Vertex('y')), Vertex('u'): Edge(Vertex('u'), Vertex('z'))}, Vertex('u'): {Vertex('v'): Edge(Vertex('v'), Vertex('u')), Vertex('w'): Edge(Vertex('w'), Vertex('u')), Vertex('z'): Edge(Vertex('u'), Vertex('z'))}, Vertex('v'): {Vertex('u'): Edge(Vertex('v'), Vertex('u')), Vertex('x'): Edge(Vertex('v'), Vertex('x')), Vertex('w'): Edge(Vertex('w'), Vertex('v'))}, Vertex('w'): {Vertex('u'): Edge(Vertex('w'), Vertex('u')), Vertex('v'): Edge(Vertex('w'), Vertex('v')), Vertex('y'): Edge(Vertex('w'), Vertex('y'))}}
End file
{
  Vertex('x'): {
    Vertex('v'): Edge(Vertex('v'), Vertex('x')), 
    Vertex('z'): Edge(Vertex('z'), Vertex('x')), 
    Vertex('y'): Edge(Vertex('y'), Vertex('x'))
  },
  Vertex('y'): {
    Vertex('x'): Edge(Vertex('y'), Vertex('x')), 
    Vertex('w'): Edge(Vertex('w'), Vertex('y')), 
    Vertex('z'): Edge(Vertex('z'), Vertex('y'))
  },
  Vertex('z'): {
    Vertex('x'): Edge(Vertex('z'), Vertex('x')), 
    Vertex('y'): Edge(Vertex('z'), Vertex('y')), 
    Vertex('u'): Edge(Vertex('u'), Vertex('z'))
  },
  Vertex('u'): {
    Vertex('v'): Edge(Vertex('v'), Vertex('u')), 
    Vertex('w'): Edge(Vertex('w'), Vertex('u')), 
    Vertex('z'): Edge(Vertex('u'), Vertex('z'))
  },
  Vertex('v'): {
    Vertex('u'): Edge(Vertex('v'), Vertex('u')), 
    Vertex('x'): Edge(Vertex('v'), Vertex('x')), 
    Vertex('w'): Edge(Vertex('w'), Vertex('v'))
  },
  Vertex('w'): {
    Vertex('u'): Edge(Vertex('w'), Vertex('u')), 
    Vertex('v'): Edge(Vertex('w'), Vertex('v')), 
    Vertex('y'): Edge(Vertex('w'), Vertex('y'))
  }
}

View Diff

1c1,32
< {Vertex('x'): {Vertex('v'): Edge(Vertex('v'), Vertex('x')), Vertex('z'): Edge(Vertex('z'), Vertex('x')), Vertex('y'): Edge(Vertex('y'), Vertex('x'))}, Vertex('y'): {Vertex('x'): Edge(Vertex('y'), Vertex('x')), Vertex('w'): Edge(Vertex('w'), Vertex('y')), Vertex('z'): Edge(Vertex('z'), Vertex('y'))}, Vertex('z'): {Vertex('x'): Edge(Vertex('z'), Vertex('x')), Vertex('y'): Edge(Vertex('z'), Vertex('y')), Vertex('u'): Edge(Vertex('u'), Vertex('z'))}, Vertex('u'): {Vertex('v'): Edge(Vertex('v'), Vertex('u')), Vertex('w'): Edge(Vertex('w'), Vertex('u')), Vertex('z'): Edge(Vertex('u'), Vertex('z'))}, Vertex('v'): {Vertex('u'): Edge(Vertex('v'), Vertex('u')), Vertex('x'): Edge(Vertex('v'), Vertex('x')), Vertex('w'): Edge(Vertex('w'), Vertex('v'))}, Vertex('w'): {Vertex('u'): Edge(Vertex('w'), Vertex('u')), Vertex('v'): Edge(Vertex('w'), Vertex('v')), Vertex('y'): Edge(Vertex('w'), Vertex('y'))}}
---
> {
>   Vertex('x'): {
>     Vertex('v'): Edge(Vertex('v'), Vertex('x')), 
>     Vertex('z'): Edge(Vertex('z'), Vertex('x')), 
>     Vertex('y'): Edge(Vertex('y'), Vertex('x'))
>   },
>   Vertex('y'): {
>     Vertex('x'): Edge(Vertex('y'), Vertex('x')), 
>     Vertex('w'): Edge(Vertex('w'), Vertex('y')), 
>     Vertex('z'): Edge(Vertex('z'), Vertex('y'))
>   },
>   Vertex('z'): {
>     Vertex('x'): Edge(Vertex('z'), Vertex('x')), 
>     Vertex('y'): Edge(Vertex('z'), Vertex('y')), 
>     Vertex('u'): Edge(Vertex('u'), Vertex('z'))
>   },
>   Vertex('u'): {
>     Vertex('v'): Edge(Vertex('v'), Vertex('u')), 
>     Vertex('w'): Edge(Vertex('w'), Vertex('u')), 
>     Vertex('z'): Edge(Vertex('u'), Vertex('z'))
>   },
>   Vertex('v'): {
>     Vertex('u'): Edge(Vertex('v'), Vertex('u')), 
>     Vertex('x'): Edge(Vertex('v'), Vertex('x')), 
>     Vertex('w'): Edge(Vertex('w'), Vertex('v'))
>   },
>   Vertex('w'): {
>     Vertex('u'): Edge(Vertex('w'), Vertex('u')), 
>     Vertex('v'): Edge(Vertex('w'), Vertex('v')), 
>     Vertex('y'): Edge(Vertex('w'), Vertex('y'))
>   }
> }

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 26 remaining solutions by signing in and submitting your own entry
#27 Dan Dorman / dandorman - Score: 77 - 05/25/12 @ 16:32
:s/\v(\{|\}(, )=|\)\)(, )=)/\1\r/g<CR>dd2G:set sw=2<CR>qw>4jj>2j4jq5@w:%s/}, /},<CR>ZZ

0 comments

#28 Jacob Vosmaer / jacobvosmaer - Score: 84 - 06/03/12 @ 13:01
:set et sts=2 sw=2<CR>:s/)), /)), \r/g<CR>:%s/{/{\r/g<CR>:%s/}/\r}/g<CR>:%s/},/},\r<CR>gg=G7G31<<ZZ

0 comments

#29 Dave@Highgroove / HighgrooveDave - Score: 85 - 05/31/12 @ 16:54
:%s/{/{\r  /g<CR><C-V>5kI  <Esc>:%s/)),/)), \r   /g<CR>:%s/))}, /))\r  },\r  /g<CR>G$$hi<CR><BS><BS><Esc>la<CR><BS><BS><Esc>:wq<CR>

0 comments

#30 Thijs Brobbel / tiesmaster - Score: 98 - 05/29/12 @ 12:46
:s/{V/{<C-V><CR>    V/g<CR>:%s/)), V/)), <C-V><CR>    V/g<CR>:%s/}, V<BS><BS><BS><BS>))}, V/))<C-V><CR>  },<C-V><CR>  V/g<CR>G$i<CR><Esc>04xk$i<CR><BS><BS><Esc>ggjxxZZ

0 comments

#31 Asenar / asenar - Score: 99 - 06/02/12 @ 20:24
aRT<Esc>:s/}, /},RT/g<CR>:s/))}/))RT}/g<CR>:s/)), \|.{/&RTT/g<CR>:s/}}/}R}/g<CR>:s/{{/{RT{/g<CR>:s/T/  /g<CR>:s/R/\r/g<CR>ZZ

0 comments

#32 Nik Johnson / JumpandSpinWin - Score: 111 - 06/01/12 @ 18:55
a<CR>  <Esc>qqf{a<CR>  <Esc>]}i<CR><BS><BS><Esc>llls<CR><Esc>q@q@q@q@q@qi<CR><BS><BS><Esc>kkkkkkkkkkkkkkkkkkjqq:s/)), /)), \r/g<BS><BS>  /g<CR>u:<Up><Left><kHome>%<kEnd><Left><Left>  <CR>:q<CR>:wq<Esc><Esc>:wq<CR>

0 comments

#33 Jason Felice / eraserhd - Score: 128 - 06/19/12 @ 23:39
:%s/\({\|)), \|))\)<BS>\<BS>|}, \|}\)/\1<C-V><CR>/g<CR>:33d<CR>:%s/}, /},<CR>:3,5><CR>u:set sw=2<CR>:3,5><CR>:8,10><CR>:13,15><CR>:18,20><CR>:23,25><CR>:28,30><CR>:2,31><CR>:wq<CR>

0 comments

Created by: philosodad

33 active golfers, 95 entries

Leaderboard (lowest score wins):
35
#1 - Urtica dioica / udioica

05/26/2012 at 11:35PM

35
#2 - Tim Chase / gumnos

05/27/2012 at 06:51PM

35
#3 - Conner McDaniel / connermcd

06/18/2012 at 02:47PM

35
#4 - Victor Ramirez / virako

10/20/2012 at 12:35AM

35
#5 - John Braxler / braxler

08/22/2014 at 01:56PM

40
#6 - Kerson Hsiao / KersonHsiao

06/25/2012 at 06:04AM

40
#7 - Tyler / tylerbindon

10/26/2013 at 04:54PM

40
#8 - Reef / Sir_Reef

08/19/2015 at 11:00PM

42
#9 - Rod Knowlton / codelahoma

05/25/2012 at 11:55PM

42
#10 - quintin / quintinjeannoel

05/30/2012 at 08:37PM

42
#11 - Justin Love / wondible

06/02/2012 at 02:58PM

42
#12 - Dimitar Dimitrov / kurkale6ka

09/15/2016 at 04:21PM

43
#13 - 無ん垢の叫び / john_ababa

05/25/2012 at 03:49PM

43
#14 - h_east (トロッコ6個) / h_east

05/25/2012 at 04:40PM

43
#15 - Édouard M'tou / DouardM

10/09/2012 at 07:42PM

46
#16 - Benoit Mortgat / Benoit_Mortgat

06/05/2012 at 07:16PM

47
#17 - Glen / Glen_S

07/22/2012 at 04:36AM

48
#18 - shutl_test / shutl_test

06/06/2012 at 12:02PM

50
#19 - Слава / slava_and_ipad

08/08/2012 at 02:35PM

50
#20 - James / Dronak

09/27/2014 at 02:26AM

53
#21 - Benson Kim / BensonRLA

06/05/2012 at 05:52PM

55
#22 - ise0615 / ise0615

05/25/2012 at 05:45PM

60
#23 - Javier Blanco / jbgutierrez

05/28/2012 at 09:49PM

69
#24 - John Whitley / johnwhitley

05/28/2012 at 05:57PM

75
#25 - Scott Nielsen / smniel

05/25/2012 at 10:34PM

75
#26 - Daniel Lundin / danielundin

05/28/2012 at 09:19AM

77
#27 - Dan Dorman / dandorman

05/25/2012 at 04:32PM

84
#28 - Jacob Vosmaer / jacobvosmaer

06/03/2012 at 01:01PM

85
#29 - Dave@Highgroove / HighgrooveDave

05/31/2012 at 04:54PM

98
#30 - Thijs Brobbel / tiesmaster

05/29/2012 at 12:46PM

99
#31 - Asenar / asenar

06/02/2012 at 08:24PM

111
#32 - Nik Johnson / JumpandSpinWin

06/01/2012 at 06:55PM

128
#33 - Jason Felice / eraserhd

06/19/2012 at 11:39PM