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 by @KaranVaity:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @jamesconroyfinn

412 active golfers, 1272 entries

Solutions by @KaranVaity:
12
#116 - Karan / @KaranVaity

05/03/2025 at 07:18AM

13
#>191 - Karan / @KaranVaity

05/03/2025 at 07:16AM

15
#>287 - Karan / @KaranVaity

05/03/2025 at 07:15AM

15
#>287 - Karan / @KaranVaity

05/03/2025 at 07:17AM

17
#>333 - Karan / @KaranVaity

05/03/2025 at 07:13AM

18
#>356 - Karan / @KaranVaity

05/03/2025 at 07:15AM

19
#>361 - Karan / @KaranVaity

05/03/2025 at 07:12AM