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

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

367 active golfers, 1986 entries

Solutions by @yancy_dong:
16
#36 - yancy / @yancy_dong

09/16/2021 at 11:46AM

17
#>93 - yancy / @yancy_dong

09/16/2021 at 11:43AM

18
#>123 - yancy / @yancy_dong

09/16/2021 at 11:39AM

19
#>132 - yancy / @yancy_dong

09/16/2021 at 11:38AM

20
#>134 - yancy / @yancy_dong

09/16/2021 at 11:30AM

21
#>141 - yancy / @yancy_dong

09/16/2021 at 11:27AM

22
#>150 - yancy / @yancy_dong

09/16/2021 at 11:26AM

23
#>166 - yancy / @yancy_dong

09/16/2021 at 11:25AM

24
#>174 - yancy / @yancy_dong

09/16/2021 at 09:58AM

25
#>179 - yancy / @yancy_dong

09/16/2021 at 09:55AM

26
#>187 - yancy / @yancy_dong

09/16/2021 at 09:51AM

27
#>202 - yancy / @yancy_dong

09/16/2021 at 09:49AM

30
#>230 - yancy / @yancy_dong

09/16/2021 at 09:37AM

32
#>256 - yancy / @yancy_dong

09/16/2021 at 09:35AM

38
#>299 - yancy / @yancy_dong

09/16/2021 at 09:33AM