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 @5eraf:

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

373 active golfers, 2023 entries

Solutions by @5eraf:
16
#7 - f a / @5eraf

12/02/2020 at 03:46PM

17
#>76 - f a / @5eraf

12/02/2020 at 03:14PM

17
#>76 - f a / @5eraf

12/02/2020 at 03:30PM

18
#>124 - f a / @5eraf

12/02/2020 at 06:02AM

18
#>124 - f a / @5eraf

12/02/2020 at 06:29AM

19
#>132 - f a / @5eraf

12/02/2020 at 02:39AM

19
#>132 - f a / @5eraf

12/02/2020 at 06:30AM

21
#>143 - f a / @5eraf

12/02/2020 at 02:41AM

22
#>149 - f a / @5eraf

12/02/2020 at 01:18AM

22
#>149 - f a / @5eraf

12/02/2020 at 02:00AM

22
#>149 - f a / @5eraf

12/02/2020 at 02:36AM

23
#>168 - f a / @5eraf

12/02/2020 at 01:26AM

23
#>168 - f a / @5eraf

12/02/2020 at 01:29AM

23
#>168 - f a / @5eraf

12/02/2020 at 01:31AM

23
#>168 - f a / @5eraf

12/02/2020 at 01:32AM

24
#>174 - f a / @5eraf

12/02/2020 at 01:02AM

25
#>180 - f a / @5eraf

11/30/2020 at 04:43PM

25
#>180 - f a / @5eraf

12/01/2020 at 05:53AM

26
#>188 - f a / @5eraf

11/30/2020 at 10:08AM

26
#>188 - f a / @5eraf

12/01/2020 at 05:40AM

26
#>188 - f a / @5eraf

12/01/2020 at 05:42AM

27
#>200 - f a / @5eraf

12/01/2020 at 05:37AM

28
#>213 - f a / @5eraf

11/30/2020 at 08:52AM

28
#>213 - f a / @5eraf

12/01/2020 at 05:23AM

29
#>219 - f a / @5eraf

11/30/2020 at 09:12AM

30
#>223 - f a / @5eraf

11/30/2020 at 09:09AM

31
#>242 - f a / @5eraf

11/30/2020 at 08:32AM

32
#>250 - f a / @5eraf

11/30/2020 at 08:13AM

33
#>268 - f a / @5eraf

11/30/2020 at 08:08AM

35
#>285 - f a / @5eraf

11/30/2020 at 08:03AM

40
#>309 - f a / @5eraf

11/30/2020 at 08:10AM