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

388 active golfers, 2128 entries

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

08/31/2023 at 08:19AM

17
#>112 - 李建宏 / @xx19971016

08/31/2023 at 08:17AM

18
#>135 - 李建宏 / @xx19971016

08/31/2023 at 08:16AM

19
#>140 - 李建宏 / @xx19971016

08/31/2023 at 08:14AM

20
#>144 - 李建宏 / @xx19971016

08/31/2023 at 08:11AM

21
#>151 - 李建宏 / @xx19971016

08/31/2023 at 08:10AM

22
#>165 - 李建宏 / @xx19971016

08/31/2023 at 08:08AM

23
#>176 - 李建宏 / @xx19971016

08/31/2023 at 08:07AM

24
#>184 - 李建宏 / @xx19971016

08/31/2023 at 08:06AM

25
#>191 - 李建宏 / @xx19971016

08/31/2023 at 08:04AM

26
#>205 - 李建宏 / @xx19971016

08/31/2023 at 08:01AM

27
#>218 - 李建宏 / @xx19971016

08/31/2023 at 07:59AM

28
#>224 - 李建宏 / @xx19971016

08/31/2023 at 07:58AM

30
#>246 - 李建宏 / @xx19971016

08/31/2023 at 07:52AM

32
#>275 - 李建宏 / @xx19971016

08/31/2023 at 07:47AM

34
#>292 - 李建宏 / @xx19971016

08/31/2023 at 07:46AM

36
#>301 - 李建宏 / @xx19971016

08/31/2023 at 07:44AM