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

393 active golfers, 2169 entries

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

08/31/2023 at 08:19AM

17
#>114 - 李建宏 / @xx19971016

08/31/2023 at 08:17AM

18
#>137 - 李建宏 / @xx19971016

08/31/2023 at 08:16AM

19
#>142 - 李建宏 / @xx19971016

08/31/2023 at 08:14AM

20
#>147 - 李建宏 / @xx19971016

08/31/2023 at 08:11AM

21
#>154 - 李建宏 / @xx19971016

08/31/2023 at 08:10AM

22
#>168 - 李建宏 / @xx19971016

08/31/2023 at 08:08AM

23
#>179 - 李建宏 / @xx19971016

08/31/2023 at 08:07AM

24
#>187 - 李建宏 / @xx19971016

08/31/2023 at 08:06AM

25
#>194 - 李建宏 / @xx19971016

08/31/2023 at 08:04AM

26
#>208 - 李建宏 / @xx19971016

08/31/2023 at 08:01AM

27
#>221 - 李建宏 / @xx19971016

08/31/2023 at 07:59AM

28
#>227 - 李建宏 / @xx19971016

08/31/2023 at 07:58AM

30
#>249 - 李建宏 / @xx19971016

08/31/2023 at 07:52AM

32
#>278 - 李建宏 / @xx19971016

08/31/2023 at 07:47AM

34
#>295 - 李建宏 / @xx19971016

08/31/2023 at 07:46AM

36
#>304 - 李建宏 / @xx19971016

08/31/2023 at 07:44AM