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

Ruby 1.9 hashes

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

Start file
{
  :a => 1,
  :b => 2,
  :c => 3
}
End file
{
  a: 1,
  b: 2,
  c: 3
}

View Diff

2,4c2,4
<   :a => 1,
<   :b => 2,
<   :c => 3
---
>   a: 1,
>   b: 2,
>   c: 3

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 381 remaining solutions by signing in and submitting your own entry
#382 Ed Gibbs / @edward_gibbs - Score: 39 - 10/05/11 @ 15:59
:%s/\s=>//g<CR>x<Up>x<Up>x<Right>:<BS>i:<Down><Left>i:<BS><BS>:<Down><Left>:<Esc>:w<CR>:q<CR>

0 comments


Created by: @jamesconroyfinn

382 active golfers, 1157 entries

Leaderboard (lowest score wins):
18
#331 - ltn614 / @ltn614

09/21/2015 at 07:40AM

18
#332 - Etienne Tremel / @etiennetremel

02/07/2016 at 09:09PM

18
#333 - Gurukandhamoorthi / @Gurukandhamoor1

07/13/2017 at 12:12PM

18
#334 - Liam Chimes / @ChimesLiam

05/02/2018 at 01:41PM

19
#335 - Kornél Lugosi / @Coornail

01/08/2011 at 10:33AM

19
#336 - codegourmet / @codegourmet

10/02/2013 at 12:40PM

19
#337 - Patrick Pitoscia / @Patrick03960431

08/10/2014 at 04:20AM

19
#338 - z0c / @zerocabal

06/12/2018 at 08:59AM

20
#339 - libicocco / @libicocco

12/31/2010 at 07:37PM

20
#340 - El Jacko / @mrjackinc

01/02/2011 at 05:21AM

20
#341 - n / @kivran

01/03/2011 at 03:52PM

20
#342 - Pablo Villalba / @micho

01/09/2011 at 03:02PM

20
#343 - Duff OMelia / @duffomelia

04/18/2011 at 10:40AM

20
#344 - IPhone Notiz / @MyIPhoneNotes

11/10/2011 at 04:57PM

20
#345 - Joe Nerdan / @JoeNerdan

12/19/2011 at 10:58PM

20
#346 - matthew / @mdespuits

02/02/2012 at 07:29PM

20
#347 - Lily / @lilibethdlc

03/06/2012 at 03:41AM

20
#348 - Axl Waii / @axlwaii

09/07/2012 at 06:49AM

20
#349 - Andy L / @akleak

10/16/2012 at 01:08PM

20
#350 - Aaron Tinio / @aptinio

10/24/2012 at 02:09PM

20
#351 - Adam Licht / @aal85255

10/22/2013 at 03:42AM

20
#352 - André Branco / @avbranco

08/30/2014 at 08:16PM

20
#353 - Jurica / @Jurica34581259

11/19/2018 at 08:37PM

20
#354 - Michael / @thscuriousquest

09/05/2021 at 02:48PM

20
#355 - shahanavaz m / @shahanavazm

02/15/2022 at 03:31AM

21
#356 - larsd / @larsd

12/31/2010 at 08:47PM

21
#357 - neleai / @enlaei

12/31/2010 at 10:10PM

21
#358 - Guillaume Bonnoron / @gbonnoron

12/31/2010 at 10:48PM

21
#359 - garygordon / @garygordon

01/02/2011 at 03:09PM

21
#360 - Dj Vimgolf / @dj_vimgolf

01/14/2012 at 05:46PM