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

Unlock 21 remaining solutions by signing in and submitting your own entry
Created by: @TimSuchanek

63 active golfers, 186 entries

Solutions by @nickandbro:
34
#3 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

35
#>21 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

36
#>27 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

37
#>29 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

38
#>32 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

39
#>36 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

40
#>39 - nickGPT / @nickandbro

08/28/2024 at 03:39AM

41
#>43 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

42
#>45 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

43
#>48 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

44
#>50 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

45
#>51 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

46
#>53 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

47
#>55 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

49
#>56 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

50
#>57 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

52
#>58 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

53
#>59 - nickGPT / @nickandbro

08/28/2024 at 03:38AM

58
#>61 - nickGPT / @nickandbro

08/28/2024 at 03:37AM

75
#>62 - nickGPT / @nickandbro

08/28/2024 at 03:37AM

78
#>63 - nickGPT / @nickandbro

08/28/2024 at 03:37AM