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):
18
#121 - David Kutschke / @D4KU_

11/12/2020 at 10:01PM

18
#122 - Andreas Siegrist / @andreaszwei

11/15/2020 at 12:33AM

18
#123 - Jonáš Šerých / @serycjon

11/15/2020 at 06:08PM

18
#124 - chocolate / @chocola81394123

11/18/2020 at 06:25AM

18
#125 - kse / @kse92733183

11/18/2020 at 04:01PM

18
#126 - ZackBurtAWS / @ZackBurtSDE

11/18/2020 at 04:10PM

18
#127 - Patty (Dionísio) / @patrickvillela

11/18/2020 at 07:01PM

18
#128 - Tyler Holien / @tylerholien

11/19/2020 at 01:17AM

18
#129 - OtterPy / @OtterPy

01/26/2021 at 03:27PM

18
#130 - grsh / @girish_i_am

05/27/2021 at 08:07AM

18
#131 - Михаил Чупринский / @nelser_by

10/09/2021 at 09:56PM

18
#132 - Jean George / @JeanGeo20504212

10/23/2021 at 11:36PM

18
#133 - Nils Melchert / @NilsMelchert

03/14/2022 at 03:33PM

18
#134 - Дмитрий Инютин / @DmitrijInutin

06/15/2022 at 09:41PM

18
#135 - キムラ・OPEL・ユウジ / @kimurayuuji79

10/21/2022 at 09:38AM

18
#136 - ndaval / @ndaval

01/14/2024 at 11:17AM

18
#137 - Nathan Priego / @nspriego

03/26/2025 at 02:23AM

19
#138 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 10:44AM

19
#139 - Björn Struckmeier / @BjrnStruckmeie1

01/03/2021 at 04:55PM

19
#140 - zapakh / @zapakh

01/21/2021 at 05:42AM

19
#141 - asirago / @asiragoo

12/13/2023 at 11:50PM

20
#142 - Demian Martinez / @demianuco

12/09/2020 at 06:13PM

20
#143 - $HA-|| / @s_k0731

01/01/2022 at 02:59AM

20
#144 - ShookerAndBeta / @Shooker2012

06/06/2022 at 07:18PM

21
#145 - Bruce Woodward / @b00ffer

11/11/2020 at 10:26AM

21
#146 - Marcin Szamotulski / @me_coot

11/11/2020 at 07:01PM

21
#147 - Arne Winter / @ArneWinter5

11/19/2020 at 01:31PM

21
#148 - Vio / @vioxcd

11/23/2020 at 05:44PM

21
#149 - Askhento / @Askhento1

01/26/2021 at 12:47AM

21
#150 - Alessandro Cantini / @aecant

10/06/2021 at 05:25PM