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 @_AlexLewin:

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

380 active golfers, 2103 entries

Solutions by @_AlexLewin:
16
#45 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:22PM

16
#>45 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:24PM

17
#>100 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:22PM

18
#>133 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:21PM

19
#>138 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:21PM

20
#>142 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:20PM

21
#>149 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:19PM

22
#>160 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:18PM

25
#>187 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:18PM

28
#>221 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:13PM

29
#>223 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:12PM

33
#>277 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:11PM