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

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

380 active golfers, 2103 entries

Solutions by @HourannLin:
16
#34 - Hourann Lin / @HourannLin

08/05/2021 at 04:28PM

17
#>94 - Hourann Lin / @HourannLin

08/05/2021 at 04:26PM

18
#>129 - Hourann Lin / @HourannLin

08/05/2021 at 04:23PM

19
#>138 - Hourann Lin / @HourannLin

08/05/2021 at 04:21PM

21
#>147 - Hourann Lin / @HourannLin

08/05/2021 at 04:18PM

22
#>156 - Hourann Lin / @HourannLin

08/05/2021 at 04:04PM

24
#>180 - Hourann Lin / @HourannLin

08/05/2021 at 04:02PM

27
#>209 - Hourann Lin / @HourannLin

08/05/2021 at 03:59PM

30
#>237 - Hourann Lin / @HourannLin

08/05/2021 at 03:55PM

31
#>248 - Hourann Lin / @HourannLin

08/05/2021 at 03:54PM

34
#>283 - Hourann Lin / @HourannLin

08/05/2021 at 03:52PM