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

40 active golfers, 146 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

35
#6 - Qing Liu / @poeminlash

08/13/2022 at 09:35PM

35
#7 - vimgolfer220902 / @vimgolfer220902

09/03/2022 at 01:32PM

35
#8 - MC / @MC88686523

03/26/2023 at 05:25PM

35
#9 - Petro Тrouq / @zulolosi

07/02/2023 at 03:12PM

35
#10 - Peppa Pig / @PeppaPi95550250

07/03/2024 at 07:18AM

39
#11 - roudens / @roudens2

02/11/2021 at 01:10PM

40
#12 - Kerson Hsiao / @KersonHsiao

06/25/2012 at 06:04AM

40
#13 - Tyler / @tylerbindon

10/26/2013 at 04:54PM

40
#14 - Reef / @Sir_Reef

08/19/2015 at 11:00PM

42
#15 - Rod Knowlton / @codelahoma

05/25/2012 at 11:55PM

42
#16 - quintin / @quintinjeannoel

05/30/2012 at 08:37PM

42
#17 - Justin Love / @wondible

06/02/2012 at 02:58PM

42
#18 - Dimitar Dimitrov / @kurkale6ka

09/15/2016 at 04:21PM

43
#19 - じょんあば / @john_ababa

05/25/2012 at 03:49PM

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

05/25/2012 at 04:40PM

43
#21 - Édouard M'tou / @DouardM

10/09/2012 at 07:42PM

46
#22 - Benoit Mortgat / @Benoit_Mortgat

06/05/2012 at 07:16PM

47
#23 - Glen / @Glen_S

07/22/2012 at 04:36AM

48
#24 - shutl_test / @shutl_test

06/06/2012 at 12:02PM

50
#25 - Слава / @slava_and_ipad

08/08/2012 at 02:35PM

50
#26 - James / @Dronak

09/27/2014 at 02:26AM

53
#27 - Benson Kim / @BensonRLA

06/05/2012 at 05:52PM

55
#28 - ise0615 / @ise0615

05/25/2012 at 05:45PM

60
#29 - Javier Blanco / @jbgutierrez

05/28/2012 at 09:49PM

66
#30 - shahanavaz m / @shahanavazm

03/19/2024 at 03:20AM