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 56a260eedb173f2f5d00f6f8

JS notation to Immutable.js notation

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

Start file
lines[1][1] = 'hello'
lines[2][0] = 'world'
lines[3][1] = 'whats'
lines[10][2] = 'going'
lines[12][1] = 'on'
End file
lines
	.setIn([1, 1], 'hello')
	.setIn([2, 0], 'world')
	.setIn([3, 1], 'whats')
	.setIn([10, 2], 'going')
	.setIn([12, 1], 'on')

View Diff

1,5c1,6
< lines[1][1] = 'hello'
< lines[2][0] = 'world'
< lines[3][1] = 'whats'
< lines[10][2] = 'going'
< lines[12][1] = 'on'
---
> lines
> 	.setIn([1, 1], 'hello')
> 	.setIn([2, 0], 'world')
> 	.setIn([3, 1], 'whats')
> 	.setIn([10, 2], 'going')
> 	.setIn([12, 1], 'on')

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 37 remaining solutions by signing in and submitting your own entry
#38 Domingue Justin / _jdomingue - Score: 46 - 01/26/16 @ 20:36
yawPa<CR><Esc>qqcfs<Tab>.setIn(<Esc>f]2s, <Esc>f 2s,<Esc>A)<Esc>0j0q4@qZZ

0 comments

#39 Will / w_labranche - Score: 46 - 08/18/16 @ 05:24
yawPa<CR><Esc>qqcfs<Tab>.setIn(<Esc>f]2s, <Esc>f 2s,<Esc>A)<Esc>0j0q4@qZZ

0 comments

#40 Kostas / blackraven_13 - Score: 47 - 02/22/16 @ 20:23
Olines<Esc>+<C-V>Gfsc<Tab>.setIn(<Esc>qqf]R, <Esc>f vlc,<Esc>A)<Esc>+q4@qZZ

0 comments

#41 Christopher Wells / ExcaliburZero_Z - Score: 49 - 01/27/16 @ 03:22
Olines<Esc>qaj0dwi<Tab>.setIn(<Esc>2w2xi, <Esc>2ea,<Esc>w2x$a)<Esc>q4@aZZ

0 comments

#42 Maciej Woźniak / eldhash - Score: 50 - 01/23/16 @ 23:21
ywO<Esc>p:%<BS>2,6norm cw<Tab>.setIn(<C-V><Esc>f]c2l, <C-V><Esc>f .xA)<C-V><Esc><CR>:wq<CR>

0 comments

#43 Marshall Croes / marshallcroes - Score: 52 - 01/25/16 @ 16:06
yw<C-V>Gec<Tab>.setIn(<Esc>$<C-V>G$A)<Esc>:%s/ = /, <CR>:%s/\]\[/, <CR>HO<C-R>0<Esc>ZZ

0 comments

#44 coryknapp / coryknapp - Score: 53 - 01/22/16 @ 22:31
qqdwi<Tab>.setIn(/<BS><Esc>/]<CR>xxi, <Esc>/=<CR>xi<BS>,<Esc>$a)<Esc>j0q4@qHOlines<Esc>ZZ

0 comments

#45 vimcoder / Khanal12Uttam - Score: 58 - 01/22/16 @ 20:02
YPf[Dj^<C-V>Ges.setIn(<Esc>:%s/\]\[/, /g<CR>:%s/ =/,/g<CR>V2G>gv<C-V>o$A)<Esc>ZZ

0 comments

#46 Shalldök / shalldoek - Score: 58 - 01/24/16 @ 18:03
YPf[Dj^<C-V>Ges.setIn(<Esc>:%s/\]\[/, /g<CR>:%s/ =/,/g<CR>V2G>gv<C-V>o$A)<Esc>ZZ

hermanjunge: "Borrowed"

1 comment

#47 Tim Suchanek / TimSuchanek - Score: 78 - 01/22/16 @ 17:10
VG:s/lines\[\(.*\)\]\[\(.*\)\]\s=\s'\(.*\)'/<Tab>.setIn([\1, \2], '\3')<CR>{Olines<Esc>ZZ

0 comments

Created by: TimSuchanek

47 active golfers, 129 entries

Leaderboard (lowest score wins):
35
#1 - Jon Krause / jkrause314

01/22/2016 at 05:42PM

35
#2 - Urtica dioica / udioica

01/22/2016 at 10:54PM

35
#3 - Roberto Carraretto / robcarraretto

01/22/2016 at 10:57PM

35
#4 - Petro Тrouq / zulolosi

01/24/2016 at 12:41AM

35
#5 - Alan Kang / alankang

01/25/2016 at 02:01PM

35
#6 - John Braxler / braxler

01/25/2016 at 03:21PM

35
#7 - Hawk Newton / hawknewton

01/26/2016 at 05:24AM

35
#8 - Austin Wood / indiesquidge

01/26/2016 at 05:51PM

35
#9 - Frederik Klama / fklama

01/27/2016 at 11:57AM

35
#10 - Smylers / Smylers2

01/27/2016 at 03:59PM

35
#11 - Saki Gw / Sakigw

01/28/2016 at 03:56PM

35
#12 - Daniel Suh / 18kehops

02/02/2016 at 03:47PM

35
#13 - Mathias Andersson / Wraul

02/13/2016 at 08:58PM

35
#14 - ben kavanagh / bkava

02/19/2016 at 06:16AM

35
#15 - Janko Jerinic / JankoJerinic

03/26/2016 at 07:13AM

35
#16 - Dinesh Bhosale / MrDineshBhosale

04/01/2016 at 03:17PM

35
#17 - Ram Tamtam / ramtamtamtam

07/06/2016 at 09:38AM

36
#18 - Matthieu Crapet / mcr05

01/31/2016 at 10:17AM

36
#19 - Dimitar Dimitrov / kurkale6ka

03/09/2016 at 04:45PM

36
#20 - Chenut Ludovic / 7Brwa7

04/11/2016 at 08:29AM

37
#21 - Ralf Haffa / fatslo

02/28/2016 at 01:39PM

38
#22 - Sebastian Pardo / sebpardo

02/29/2016 at 07:57AM

38
#23 - Ricardo Lima / ricardolimaapps

03/07/2016 at 02:37PM

38
#24 - Carlos A Henríquez Q / lagunex

03/13/2016 at 03:52PM

39
#25 - John Smith / literacyisgood

02/13/2016 at 12:10PM

39
#26 - Michel Ganguin / tinycrazyfish

03/03/2016 at 11:57AM

39
#27 - Daniel / Daniel00288663

03/31/2017 at 01:37PM

40
#28 - Martin Lehmann / Theneva

01/24/2016 at 02:26AM

41
#29 - Todd Branchflower / toddbranch

01/22/2016 at 05:19PM

41
#30 - Thijs van den Anker / thijsvdanker

02/15/2016 at 08:10PM

41
#31 - Kyouma / kyoumaJohn

10/14/2016 at 08:23PM

42
#32 - Samuel Masuy / samasuy

01/23/2016 at 01:40AM

43
#33 - RobertT / techrt2050

01/28/2016 at 06:26AM

43
#34 - Roland Hougs / OminousWater

01/31/2016 at 07:38PM

43
#35 - Cristian Lupașcu / clupasq

02/02/2016 at 03:47PM

44
#36 - Gerald Tilma / GeraldTilma

02/04/2016 at 01:51AM

45
#37 - Michael Prouty / MProuts

01/25/2016 at 06:55PM

46
#38 - Domingue Justin / _jdomingue

01/26/2016 at 08:36PM

46
#39 - Will / w_labranche

08/18/2016 at 05:24AM

47
#40 - Kostas / blackraven_13

02/22/2016 at 08:23PM

49
#41 - Christopher Wells / ExcaliburZero_Z

01/27/2016 at 03:22AM

50
#42 - Maciej Woźniak / eldhash

01/23/2016 at 11:21PM

52
#43 - Marshall Croes / marshallcroes

01/25/2016 at 04:06PM

53
#44 - coryknapp / coryknapp

01/22/2016 at 10:31PM

58
#45 - vimcoder / Khanal12Uttam

01/22/2016 at 08:02PM

58
#46 - Shalldök / shalldoek

01/24/2016 at 06:03PM

78
#47 - Tim Suchanek / TimSuchanek

01/22/2016 at 05:10PM