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

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

380 active golfers, 2103 entries

Solutions by @liuxian1990:
16
#6 - 六弦 / @liuxian1990

11/28/2020 at 11:46AM

17
#>75 - 六弦 / @liuxian1990

11/28/2020 at 11:43AM

18
#>127 - 六弦 / @liuxian1990

11/28/2020 at 11:42AM

21
#>146 - 六弦 / @liuxian1990

11/28/2020 at 11:41AM

22
#>151 - 六弦 / @liuxian1990

11/28/2020 at 11:40AM

23
#>168 - 六弦 / @liuxian1990

11/28/2020 at 11:39AM

24
#>177 - 六弦 / @liuxian1990

11/28/2020 at 11:39AM

25
#>183 - 六弦 / @liuxian1990

11/28/2020 at 11:38AM

26
#>191 - 六弦 / @liuxian1990

11/28/2020 at 11:36AM

27
#>204 - 六弦 / @liuxian1990

11/28/2020 at 11:30AM

28
#>217 - 六弦 / @liuxian1990

11/28/2020 at 11:23AM

32
#>255 - 六弦 / @liuxian1990

11/28/2020 at 11:17AM

33
#>273 - 六弦 / @liuxian1990

11/28/2020 at 11:17AM

35
#>290 - 六弦 / @liuxian1990

11/28/2020 at 11:16AM

37
#>300 - 六弦 / @liuxian1990

11/28/2020 at 11:10AM

41
#>325 - 六弦 / @liuxian1990

11/28/2020 at 10:52AM

47
#>340 - 六弦 / @liuxian1990

11/28/2020 at 10:51AM

57
#>358 - 六弦 / @liuxian1990

11/28/2020 at 10:47AM