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):
21
#361 - Christopher Brew / @Seph1rothVII

01/17/2012 at 10:26PM

21
#362 - Nathaniel Barnes / @NathanielBarnes

06/21/2012 at 05:48AM

21
#363 - CHIP CASTLE / @chipcastle

12/27/2013 at 04:50AM

21
#364 - matti jauhiainen / @GmTapio

01/28/2014 at 09:19PM

21
#365 - Micheal Wells / @michealwwells

08/10/2018 at 06:02PM

22
#366 - Daniel Grippi / @danielgrippi

12/31/2010 at 07:36PM

22
#367 - Gonzih / @Gonzih

03/24/2011 at 03:08PM

22
#368 - Jyun-Fan Tsai / @fakecolor

02/11/2012 at 01:00AM

23
#369 - Siripong Boonchaiya / @siripong

01/01/2011 at 03:31AM

23
#370 - kārlis / @skazhy

01/03/2011 at 10:48AM

23
#371 - Brian / @bglusman

02/06/2012 at 02:39PM

23
#372 - Trever Marshall / @dynamic_library

10/12/2012 at 08:33PM

24
#373 - Charlie Massry / @charlesmassry

09/03/2014 at 12:24AM

24
#374 - fuku1026 / @fukusuke1026

07/13/2017 at 01:59PM

25
#375 - aimee / @sermoa

01/02/2011 at 08:38PM

25
#376 - Wojciech Pietrzak / @astropanic

06/15/2011 at 12:58PM

25
#377 - Avijit Gupta / @526avijit

03/25/2017 at 08:20AM

27
#378 - Mike Perham / @mperham

01/30/2011 at 11:22PM

28
#379 - Joe Auricchio / @jauricchio

01/01/2011 at 12:29AM

28
#380 - Feanor Celebrimbor / @tumbaletaurea

06/02/2012 at 08:39PM

28
#381 - BiHi / @BiHi

06/14/2012 at 12:01PM

39
#382 - Ed Gibbs / @edward_gibbs

10/05/2011 at 03:59PM