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):
12
#91 - deurzen / @devrzen

06/06/2019 at 01:39PM

12
#92 - Vimfiz / @vimfiz

06/07/2019 at 04:54PM

12
#93 - Sigurður Ægir Jónsso / @siggiae

06/09/2019 at 10:49PM

12
#94 - majo senf / @majo_senf

06/21/2019 at 03:18PM

12
#95 - Himavanth Reddy / @Himavanth1909

08/12/2019 at 06:27AM

12
#96 - Melvin Cheung / @MelvinCheung

11/13/2019 at 02:29AM

12
#97 - Miłosz Łakomy / @foobar01123

12/22/2019 at 03:28PM

12
#98 - Marko / @ultrox

12/28/2019 at 03:05AM

12
#99 - Finlay l͓̽o͓̽c͓̽k͓̽e͓̽d͓̽d͓̽o͓̽w͓̽n͓̽ McAfee / @finsqm

06/09/2020 at 06:46PM

12
#100 - Jason / @jason_eveleth

07/23/2020 at 08:23AM

12
#101 - Salvador Tojo Quintela / @SalvadorTojo

10/08/2021 at 06:15PM

12
#102 - Chris / @cridahtweets

02/26/2022 at 12:30PM

12
#103 - russellzhaomao / @russellzhaomao

05/25/2022 at 03:22AM

12
#104 - x03n046 / @x03n046

06/10/2022 at 12:08AM

13
#105 - Douglas Stockwell / @dstockwell

12/31/2010 at 07:27PM

13
#106 - Utkarsh Kukreti / @utkarshkukreti

12/31/2010 at 08:20PM

13
#107 - Henri Bourcereau / @mmai

12/31/2010 at 08:40PM

13
#108 - Alain Gilbert / @alain_gilbert

12/31/2010 at 08:51PM

13
#109 - Behnam Esfahbod / @zwnj

12/31/2010 at 08:54PM

13
#110 -  Ikhsan Maulana / @ixandidu

12/31/2010 at 09:14PM

13
#111 - Ricardo Mendes / @locks

12/31/2010 at 09:42PM

13
#112 - Dmytro Shteflyuk / @kpumuk

12/31/2010 at 09:45PM

13
#113 - Israel Chauca F. / @Raimondi

12/31/2010 at 11:00PM

13
#114 - Tim Chase / @gumnos

01/01/2011 at 01:11AM

13
#115 - xer0x / @xer0x

01/01/2011 at 01:18AM

13
#116 - Brandon Ferguson / @bnferguson

01/01/2011 at 01:51AM

13
#117 - Matthew Draper / @_matthewd

01/01/2011 at 02:45AM

13
#118 - Thedward the Edward / @thedward

01/01/2011 at 07:46AM

13
#119 - Jim Garvin / @coderifous

01/01/2011 at 03:53PM

13
#120 - Renaud Morvan / @neleanth

01/01/2011 at 10:53PM