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):
17
#91 - Michael / @Michael62785035

05/23/2021 at 11:54PM

17
#92 - Georg Bökman / @BokmanGeorg

07/03/2021 at 04:37PM

17
#93 - I_Don't_Want_This_Account / @IDontWa59298038

07/15/2021 at 12:27AM

17
#94 - ボードゲーム! / @boardgame_JP

07/17/2021 at 10:07PM

17
#95 - Michel Viktor / @tomkpz

08/11/2021 at 08:22PM

17
#96 - Jon Karl Sigurdsson / @Math_Meditation

09/13/2021 at 10:51PM

17
#97 - Humbaba / @humbabu

12/31/2021 at 10:53PM

17
#98 - Youssef Magdy / @youssef_magdy29

05/01/2022 at 02:11AM

17
#99 - loupiot.veloce / @LoupiotVeloce

07/22/2022 at 08:53PM

17
#100 - z00master / @z00master

08/05/2022 at 05:12PM

17
#101 - monika gadage / @gadage_moni

09/24/2022 at 11:56PM

17
#102 - Vinicius Azevedo Pinheiro / @Viniciu42652081

10/10/2022 at 06:29AM

17
#103 - Nancho Alvarez / @nancho_alvarez

10/22/2022 at 02:18PM

17
#104 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 01:19PM

17
#105 - DW Luna / @dcheed_

12/21/2022 at 06:19AM

17
#106 - 94 / @kyu08_

04/11/2023 at 11:02AM

17
#107 - Koceto / @Koceto691735529

04/23/2023 at 12:48AM

17
#108 - John Huynh / @huynh_j93

04/30/2023 at 03:06AM

17
#109 - someone / @IKvacenok

06/13/2023 at 07:48PM

17
#110 - 7733865@qq.com / @tjxwg

07/05/2023 at 10:04AM

17
#111 - jinx balotchnik / @balotchnik

07/22/2023 at 11:16PM

17
#112 - moh ayaya / @AyayaMoh

08/26/2023 at 09:13PM

17
#113 - Luoyb / @Luoyb

10/25/2023 at 02:49AM

17
#114 - naka / @nak38223985244

10/28/2023 at 12:55PM

17
#115 - EtherFan / @ether_fan

02/25/2024 at 02:10PM

17
#116 - 🥚 / @schmarles_

11/09/2024 at 10:03PM

17
#117 - k1mosabe / @k1mosabe

12/03/2024 at 03:14AM

17
#118 - jimmymills / @jimmymills

05/21/2025 at 09:25PM

18
#119 - Ceda EI / @ceda_ei

11/10/2020 at 01:38PM

18
#120 - Saki Gw / @Sakigw

11/12/2020 at 02:06PM