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):
15
#241 - Francisco Dibar / @frandibar

01/11/2011 at 02:48AM

15
#242 - Wonha Ryu / @beingryu

01/11/2011 at 06:11AM

15
#243 - Anatoliy C. / @1602

01/19/2011 at 09:19AM

15
#244 - Gennady / @lynxbyorion

01/19/2011 at 01:19PM

15
#245 - deris / @deris0126

01/27/2011 at 10:52PM

15
#246 - radamant / @radamant

03/06/2011 at 11:12PM

15
#247 - mightyfoo / @mightyfoo

05/26/2011 at 08:43PM

15
#248 - こばばー / @symmet

09/28/2011 at 12:42AM

15
#249 - Dave E / @DaveRElliott

01/04/2012 at 11:52PM

15
#250 - Felipe Talavera / @flype

01/18/2012 at 01:12AM

15
#251 - public function / @publicfunction

04/23/2012 at 03:08PM

15
#252 - Daumantas / @dbaltrus

05/03/2012 at 09:07AM

15
#253 - Reed Riley / @ReedRile

08/14/2012 at 04:53PM

15
#254 - Adelar S. Queiróz / @adelarsq

11/27/2012 at 12:43AM

15
#255 - Justin / @justinjaffray

04/24/2013 at 01:46PM

15
#256 - brett / @brettyukich

09/21/2013 at 10:49PM

15
#257 - Eric Potter / @pottereric

12/20/2013 at 07:32PM

15
#258 - Jérémy Autran / @jjautran

01/29/2014 at 05:38PM

15
#259 - João Paiva / @jgpaiva

01/31/2014 at 06:26PM

15
#260 - Phil Pirozhkov / @philpirj

05/17/2014 at 01:19PM

15
#261 - Sntano Euhsk / @SEuhsk

06/06/2014 at 06:16PM

15
#262 - Ram Tamtam / @ramtamtamtam

06/30/2014 at 11:59AM

15
#263 - Herr Oppermann / @HerrOppermann

09/18/2014 at 01:50PM

15
#264 - David Daniel / @davedan7

03/20/2015 at 05:18PM

15
#265 - Jeffrey Gu / @Jeffrey_Gu

03/20/2015 at 05:19PM

15
#266 - Hendrik Lammers / @hendriklammers

06/24/2015 at 05:42PM

15
#267 - Andrew Michaud / @andrewjmichaud

02/08/2016 at 09:59AM

15
#268 - mattp (part of the 💉💉💉 club) / @mattpep

05/19/2016 at 08:39PM

15
#269 - Michał Dytko / @DytkoM

12/28/2016 at 09:44AM

15
#270 - Harish / @itzharish_c

05/12/2020 at 10:27AM