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

380 active golfers, 2103 entries

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

08/31/2023 at 08:19AM

17
#>112 - 李建宏 / @xx19971016

08/31/2023 at 08:17AM

18
#>134 - 李建宏 / @xx19971016

08/31/2023 at 08:16AM

19
#>138 - 李建宏 / @xx19971016

08/31/2023 at 08:14AM

20
#>142 - 李建宏 / @xx19971016

08/31/2023 at 08:11AM

21
#>149 - 李建宏 / @xx19971016

08/31/2023 at 08:10AM

22
#>163 - 李建宏 / @xx19971016

08/31/2023 at 08:08AM

23
#>174 - 李建宏 / @xx19971016

08/31/2023 at 08:07AM

24
#>182 - 李建宏 / @xx19971016

08/31/2023 at 08:06AM

25
#>188 - 李建宏 / @xx19971016

08/31/2023 at 08:04AM

26
#>202 - 李建宏 / @xx19971016

08/31/2023 at 08:01AM

27
#>215 - 李建宏 / @xx19971016

08/31/2023 at 07:59AM

28
#>221 - 李建宏 / @xx19971016

08/31/2023 at 07:58AM

30
#>243 - 李建宏 / @xx19971016

08/31/2023 at 07:52AM

32
#>271 - 李建宏 / @xx19971016

08/31/2023 at 07:47AM

34
#>288 - 李建宏 / @xx19971016

08/31/2023 at 07:46AM

36
#>297 - 李建宏 / @xx19971016

08/31/2023 at 07:44AM