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 330 remaining solutions by signing in and submitting your own entry
#331 Khalin George / @Khalin_George - Score: 116 - 12/02/20 @ 18:42
<Right><Left>]ewwweWWv<Esc><Esc>bbbbbbbvllxpx<Left>x<Left>i, <Esc>:w<CR>wlllllr4<Right><Right><Right>45r5<Left><Right>5<Down><Up><Up><Up>r5<Left><Right>r5jhhhhr3lllr6jr7jkhhhr4jr2lllljhr8llllllr1llllr2<Esc>:wq<CR>

0 comments


#332 θ—€η”°ζ‹“ιƒŽ / @FujitaTakuro - Score: 116 - 05/23/21 @ 11:30
l<C-V>3l4jhxlpuhp<C-V>4jlI, <Esc>;lll<C-V>lljhjjxllllLjhk1jhjjkkk;;;;lllllllll<C-V>llxlPlxxhi, <Esc>Gwwwwwl<C-V>llllxu<C-V>lllxllp<C-U>uPi, l<BS><Esc>lllxx:wq<CR>

0 comments


Created by: @wedesoft

332 active golfers, 1808 entries

Leaderboard (lowest score wins):
20
#121 - $HA-|| / @s_k0731

01/01/2022 at 02:59AM

20
#122 - ShookerAndBeta / @Shooker2012

06/06/2022 at 07:18PM

21
#123 - Bruce Woodward / @b00ffer

11/11/2020 at 10:26AM

21
#124 - Marcin Szamotulski / @me_coot

11/11/2020 at 07:01PM

21
#125 - Arne Winter / @ArneWinter5

11/19/2020 at 01:31PM

21
#126 - Vio / @vioxcd

11/23/2020 at 05:44PM

21
#127 - Askhento / @Askhento1

01/26/2021 at 12:47AM

21
#128 - Alessandro Cantini / @aecant

10/06/2021 at 05:25PM

21
#129 - Arthur DELORT / @artDelort

06/15/2022 at 03:49PM

22
#130 - Aioriya / @AioriyaDonk

11/14/2020 at 11:29PM

22
#131 - LeLycal.tar.gz πŸ’Ύ / @Lycal3

12/01/2020 at 09:59AM

22
#132 - mevmev / @mevmev8

12/04/2020 at 01:06AM

22
#133 - angel / @anmaso

12/04/2020 at 10:30PM

22
#134 - Dave Millican / @dave_millican

01/18/2021 at 12:22PM

22
#135 - Calarasanu Andrei / @_fanfani4_

05/28/2021 at 03:01PM

22
#136 - Vladislav Straka / @StrakaVladislav

11/24/2021 at 01:36AM

22
#137 - POSIX / @po6ix

02/01/2022 at 04:42AM

22
#138 - πš‹πš›πš’πšŠπš— / @Brianjp93

05/06/2022 at 05:45PM

22
#139 - brett / @brettyukich

09/05/2022 at 03:53PM

22
#140 - James Marshall / @astrophd

10/12/2022 at 06:37PM

22
#141 - James / @Dronak

10/23/2022 at 04:06AM

23
#142 - VinΓ­cius Hoyer / @viniciushoyer

11/09/2020 at 06:14PM

23
#143 - RaylanFox / @RaylanFox

11/10/2020 at 08:17AM

23
#144 - Amar Battulga / @amar_battulga

11/10/2020 at 11:01PM

23
#145 - Wayne / @lilwayne15561

11/14/2020 at 03:28AM

23
#146 - pady. πŸ‡ͺπŸ‡Ί / @hundertzwoelf_

12/01/2020 at 04:11PM

23
#147 - altamente / @altamnt

12/01/2020 at 05:00PM

23
#148 - Vinicius Gardelli / @itsthegards

12/01/2020 at 08:13PM

23
#149 - speisz / @speiszc

01/20/2021 at 10:34PM

23
#150 - ._. / @Katharsic

04/24/2022 at 02:25PM