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

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

373 active golfers, 2022 entries

Solutions by @xx19971016:
16
#55 - 李建宏 / @xx19971016

08/31/2023 at 08:19AM

17
#>110 - 李建宏 / @xx19971016

08/31/2023 at 08:17AM

18
#>131 - 李建宏 / @xx19971016

08/31/2023 at 08:16AM

19
#>135 - 李建宏 / @xx19971016

08/31/2023 at 08:14AM

20
#>139 - 李建宏 / @xx19971016

08/31/2023 at 08:11AM

21
#>146 - 李建宏 / @xx19971016

08/31/2023 at 08:10AM

22
#>160 - 李建宏 / @xx19971016

08/31/2023 at 08:08AM

23
#>171 - 李建宏 / @xx19971016

08/31/2023 at 08:07AM

24
#>179 - 李建宏 / @xx19971016

08/31/2023 at 08:06AM

25
#>185 - 李建宏 / @xx19971016

08/31/2023 at 08:04AM

26
#>199 - 李建宏 / @xx19971016

08/31/2023 at 08:01AM

27
#>211 - 李建宏 / @xx19971016

08/31/2023 at 07:59AM

28
#>217 - 李建宏 / @xx19971016

08/31/2023 at 07:58AM

30
#>239 - 李建宏 / @xx19971016

08/31/2023 at 07:52AM

32
#>266 - 李建宏 / @xx19971016

08/31/2023 at 07:47AM

34
#>283 - 李建宏 / @xx19971016

08/31/2023 at 07:46AM

36
#>292 - 李建宏 / @xx19971016

08/31/2023 at 07:44AM