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 5fa95fbdd285680008e41e4b

swap number pairs

Swap the numbers in a bunch of 2-element arrays.

Start file
[2, 1], [5, 4]
[6, 3]
[7, 4]
[8, 2], [12, 11]
End file
[1, 2], [4, 5]
[3, 6]
[4, 7]
[2, 8], [11, 12]

View Diff

1,4c1,4
< [2, 1], [5, 4]
< [6, 3]
< [7, 4]
< [8, 2], [12, 11]
---
> [1, 2], [4, 5]
> [3, 6]
> [4, 7]
> [2, 8], [11, 12]

Solutions by @huynh_j93:

Unlock 16 remaining solutions by signing in and submitting your own entry
Created by: @wedesoft

377 active golfers, 2066 entries

Solutions by @huynh_j93:
17
#107 - John Huynh / @huynh_j93

04/30/2023 at 03:06AM

18
#>131 - John Huynh / @huynh_j93

04/30/2023 at 02:54AM

18
#>131 - John Huynh / @huynh_j93

04/30/2023 at 02:57AM

19
#>135 - John Huynh / @huynh_j93

04/30/2023 at 02:54AM

20
#>139 - John Huynh / @huynh_j93

04/30/2023 at 02:52AM

21
#>146 - John Huynh / @huynh_j93

04/30/2023 at 02:51AM

22
#>160 - John Huynh / @huynh_j93

04/30/2023 at 02:50AM

23
#>171 - John Huynh / @huynh_j93

04/30/2023 at 02:50AM

24
#>179 - John Huynh / @huynh_j93

04/30/2023 at 02:48AM

25
#>185 - John Huynh / @huynh_j93

04/30/2023 at 02:42AM

25
#>185 - John Huynh / @huynh_j93

04/30/2023 at 02:44AM

26
#>199 - John Huynh / @huynh_j93

04/30/2023 at 02:42AM

27
#>212 - John Huynh / @huynh_j93

04/30/2023 at 02:41AM

30
#>240 - John Huynh / @huynh_j93

04/30/2023 at 02:39AM

35
#>291 - John Huynh / @huynh_j93

04/30/2023 at 02:29AM

44
#>329 - John Huynh / @huynh_j93

04/30/2023 at 02:23AM