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 50b5266f448d770002000106

Readable Rubyhash

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

1c1,5
< {: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 66 remaining solutions by signing in and submitting your own entry
#67 Zach Kemp / zvksf - Score: 31 - 12/13/13 @ 23:21
:%s;:;\r  ;g<CR>qalR: <Esc>-q2@a%i<CR><Esc>ZZ

0 comments


#68 Reuben Narkwo / reubwo - Score: 31 - 03/31/17 @ 07:33
:%s/:/\r  /g<CR>:%s/=>/: /g<CR>$i<CR><Esc>ZZ

0 comments


#69 w1zeman1p / wizemanip - Score: 32 - 05/10/14 @ 04:03
:%s/:\(\w\)=>/\r  \1: /g<CR>A<BS><CR>}<Esc>ZZ

0 comments


#70 Ryan van Rensburg / rdvr001 - Score: 34 - 07/23/16 @ 12:48
qqf:i<CR><Esc><<2I <Esc>f:xpl2xi <Esc>q2@qf}i<CR><Esc>ZZ

0 comments


#71 Eric Andres / eric_m_andres - Score: 37 - 12/04/12 @ 21:37
:%s/:/\r/g<CR>f3a<CR><Esc>2G<C-V>jjI  <Esc>f=<C-V>ljjc: <Esc>ZZ

0 comments


#72 Jesse Nazario / JesseNazario - Score: 37 - 04/19/13 @ 18:58
a<CR><BS>  <Esc>f,a<CR><Esc>;.f]f}i<CR><Esc>kw<C-V>2kdpl<C-V>2jlc <Esc>ZZ

0 comments


#73 Joshua Travis / jktravis - Score: 38 - 11/28/12 @ 02:29
:s/:/\r/g<CR>$i<CR><Esc>kI  <Esc>k.k.:%s/=>:<BS>/: /<CR>ZZ

0 comments


#74 Ravi S Sinha / ambidextrousTx - Score: 38 - 11/28/12 @ 23:49
:s/:/\r:/g<CR>$i<CR><Esc>kqaxpI  <Esc>f=xR <Esc>0kq2@aZZ

0 comments


#75 Oliver Christ / 0liverChrist - Score: 39 - 10/04/13 @ 22:13
a<CR><BS><End><Left><CR><Up><Esc>qaxpa <Del><Del><Right><Right><CR>q<BS><Esc>q@a@addk<C-V>kkI  <Esc>ZZ

0 comments


#76 Gurukandhamoorthi / Gurukandhamoor1 - Score: 39 - 08/21/17 @ 15:42
:s/:/\n<BS>r  /<CR>u:<Up>g<CR>$i<CR><Esc>:%s/==<BS>>/: /g<BS><CR>ZZ

0 comments


#77 Tomasz Jureczko / codehaha - Score: 41 - 11/27/12 @ 21:01
:s/[{,]/&\r/g<CR>:%s/:\(.\)=>/  \1: /<CR>$i<CR><Esc>ZZ

0 comments


#78 Vimgolf Pikob / vimgolfpikob - Score: 42 - 12/02/12 @ 19:00
:s/:\(.\)=>\(.\),\=/<C-V><CR>  \1: \2,/g<CR>f,r<CR>z<BS>ZZ

0 comments


#79 Jim Jones / zimzumzam - Score: 46 - 08/14/13 @ 10:23
:s/:/\r/g<CR>$$i<CR><Esc>kI  <Esc>k.jkk.:%s/=>:<BS>/: /<CR>:<BS><C-Z>:wq<CR>

0 comments


#80 One More Anonymous / anonymous_joe - Score: 49 - 04/16/13 @ 13:12
:%s/:/<C-V><CR>/g<CR>:5<BS>%s/=>/: /g<CR><C-V>kkI  <Esc>kllljjjjf}i<CR><Esc>:wq<CR>

0 comments


#81 Scott Harvey / scottharveyco - Score: 54 - 11/29/12 @ 09:23
a<CR><BS>  <Esc>f2hhhhi<CR><Esc>2f:i<CR><Esc>f}i<CR><Esc><Esc>:%s/://g<CR><Esc>:%s/=>/: /g<CR><Esc>:wq<CR>

0 comments


#82 Alexander Berezovsky / _a0b_ - Score: 71 - 04/30/13 @ 18:51
:<Up>set shiftwidth=2<CR>=G:<Up><Down>%s/:/\r/g<CR>g_i<Esc>a<CR><Esc>:<Up><Up><Down><Left><Left><Left><Left><Left><BS>=><Right><Right><Right><BS><BS>: <CR>gg=G:w<BS>wq<CR>

0 comments


#83 Chris Maguire / chriswmaguire - Score: 104 - 11/28/12 @ 15:01
a<CR><<BS><Esc><<CR><Esc><BS><BS>jjx  hhi  <Esc>llllhlhhhxa:<Esc>lxxi <Esc>lll<CR><CR>i<CR>x<BS><Esc>lxlxxi: <Esc>lll<CR>i<CR><Esc>xhxxi  <Esc>ll:<Esc>i: x<BS><BS><Esc><Esc>lxx <BS>i <Esc>lli<CR><Esc><Esc>:wq<CR>

0 comments


Created by: VimLondon

83 active golfers, 226 entries

Leaderboard (lowest score wins):
23
#1 - Adelar S. Queiróz / adelarsq

11/28/2012 at 10:58PM

23
#2 - Harry Garrood / hdgarrood

12/03/2012 at 11:34PM

23
#3 - Petro Тrouq / zulolosi

06/07/2013 at 09:06PM

24
#4 - Conner McDaniel / connermcd

11/28/2012 at 04:40AM

24
#5 - a24f0600 / a24f0600

11/28/2012 at 04:41PM

24
#6 - Urtica dioica / udioica

12/12/2012 at 07:58AM

24
#7 - John Braxler / braxler

05/06/2014 at 06:15PM

24
#8 - alex scott / 4l3xsc0tt

07/02/2014 at 01:41PM

24
#9 - Turkey Man / lvturkeyman

12/06/2017 at 10:09AM

24
#10 - DHM / DHM29978992

05/29/2018 at 12:45AM

25
#11 - Vasil Sakarov / vsakarov

11/30/2012 at 01:07AM

26
#12 - Daniel Lundin / danielundin

11/28/2012 at 11:57AM

26
#13 - Scott McGinness / scottie_000

11/29/2012 at 01:32PM

26
#14 - Hubba / HubbaBubbaFett

11/29/2012 at 09:26PM

26
#15 - 無ん垢の叫び / john_ababa

12/02/2012 at 04:30PM

26
#16 - Kerson Hsiao / KersonHsiao

03/29/2013 at 10:44AM

26
#17 - Tyler / tylerbindon

04/03/2013 at 04:29AM

26
#18 - Trevor Powell / DoomedBunnies

04/11/2013 at 03:05AM

26
#19 - Marco Hinz / _mhinz_

05/26/2013 at 12:22PM

26
#20 - Bradd Szonye / bszonye

07/14/2013 at 06:51AM

27
#21 - Adam Dratwinski / adwinsky

11/27/2012 at 09:07PM

27
#22 - mattgibb / mattgibb

11/27/2012 at 09:10PM

27
#23 - Marcin Sza / coot_

11/28/2012 at 02:04AM

27
#24 - Nick Bakkegaard / Bakkemand

11/28/2012 at 01:44PM

27
#25 - Tom Cammann / tea_sea

11/28/2012 at 05:07PM

27
#26 - Jason Wolf / zephyr_wolf

11/28/2012 at 07:49PM

27
#27 - meatcar / meatcar

11/28/2012 at 08:04PM

27
#28 - David Barnett / mu_mind

11/29/2012 at 10:38AM

27
#29 - Jordan Eldredge / captbaritone

12/01/2012 at 05:40AM

27
#30 - Django Janny / keltroth

12/08/2012 at 04:34PM