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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 387 remaining solutions by signing in and submitting your own entry
#388 ahappyston1 / @ahappyston1 - Score: 120 - 09/27/24 @ 10:32
<Right><Right><Left><Left><Left><Esc><Right><Down><Right><Up><Down><Left><Up><Right><BS><Right>i<BS><BS><C-Z><C-Z><BS><BS><BS><BS><BS>[2<Right><Left><BS>1<Right><Right><Right><BS>2<Right><Right><Right><Right><Right><BS>4<Right><Right><Right><Right><Left><Del>5<C-Z><BS><BS><BS>5]<Down><Left><Left><Left><Left><BS>4<BS>3<Right><Right><Right><BS>6<Down><Left><Left><Left><BS>4<Right><Right><Right><BS>7<Down><Left><Left><Left><BS>2<Right><Right><Right><BS>8<Right><Right><Right><Right><Right><Right><BS>1<Right><Right><Right><Right><BS>2<Esc>":<BS><BS><BS><BS><BS><PageDown>:wq<CR>

0 comments


Created by: @wedesoft

388 active golfers, 2128 entries

Leaderboard (lowest score wins):
40
#331 - donghwanjin / @donghwanjin

07/02/2025 at 10:54AM

41
#332 - Rory Smith / @alan0buchanan

09/14/2021 at 10:08PM

41
#333 - Yeontaek Kim / @YeontaekK

09/17/2021 at 12:20PM

41
#334 - 素村 / @so_No_50xx

12/26/2022 at 02:40AM

41
#335 - Finlay McAfee / @finsqm

02/01/2023 at 05:54PM

42
#336 - ajay.vimgolf / @AjayVimgolf

11/11/2020 at 03:54PM

42
#337 - joao neto / @joaonet49907796

05/18/2021 at 11:46AM

43
#338 - Supreme Paudel / @paudsu01

06/03/2024 at 06:31PM

43
#339 - SRINIVASU SALADI / @SRINIVASUS22587

02/13/2025 at 04:22PM

44
#340 - lovebigwei / @lovebigwei

12/27/2024 at 08:05AM

45
#341 - hejhopp87 / @hejhopp87

12/05/2020 at 08:11PM

45
#342 - BOEHBAA / @BOEHBAA

09/29/2021 at 03:18PM

45
#343 - Andrew Tongen / @atongen

11/02/2021 at 07:03PM

45
#344 - Subsector3174 / @subsector3174

01/29/2023 at 01:08AM

45
#345 - 马海洋 / @LG41bT7ZvqOdFl3

02/05/2023 at 10:29PM

46
#346 - Noise Official / @zmunk19

11/12/2020 at 08:33AM

46
#347 - Alex Kubica / @alexkubicail

11/12/2020 at 10:11AM

46
#348 - D G G / @DGJourneyman

02/20/2023 at 11:04AM

47
#349 - vesa / @XingfDu

01/08/2021 at 11:34AM

47
#350 - yevallus / @yevallus

03/10/2022 at 02:53PM

49
#351 - Buatvimgolf / @buatvimgolf

07/05/2022 at 08:24AM

49
#352 - ひま / @sux2mfgj_gz

12/15/2022 at 01:36PM

50
#353 - Bo Xie / @iebox

12/05/2020 at 03:52AM

50
#354 - りょー / @ryoo141

01/10/2021 at 03:20AM

50
#355 - panakin skywalker / @_j3ffrey

08/31/2021 at 03:10PM

50
#356 - Ali Aslan / @AliAsla95742367

10/27/2021 at 01:27AM

51
#357 - just here to scroll. / @idontknow0001

11/15/2020 at 04:28PM

51
#358 - aravindthangavel / @aravindpt

04/11/2022 at 04:44AM

52
#359 - Ken Powers / @knpwrs

11/11/2020 at 03:25PM

52
#360 - Matilda Amy / @Matilda_Amy2

03/30/2023 at 05:14PM