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 332 remaining solutions by signing in and submitting your own entry
#333 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


#334 藤田拓郎 / @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

334 active golfers, 1810 entries

Leaderboard (lowest score wins):
23
#151 - Golfer / @Golfer56598542

06/24/2022 at 11:51AM

24
#152 - majo senf / @majo_senf

11/13/2020 at 09:17AM

24
#153 - SEbbaDK / @SEbbaDK

12/04/2020 at 02:54PM

24
#154 - 大矢元海 / @008Genkai

01/07/2021 at 02:03AM

24
#155 - grosa / @_grosa_

06/15/2021 at 03:17AM

24
#156 - Scott Berger / @scottberger

09/24/2021 at 01:04PM

24
#157 - fufuror / @futachima

01/25/2023 at 05:19PM

25
#158 - jirgn / @jirgn

11/12/2020 at 01:31AM

25
#159 - John Other / @john_other

12/06/2020 at 04:09AM

25
#160 - Peter Pandorum / @PeterPandorum

08/08/2021 at 09:01AM

25
#161 - Dima Horshenin / @DimaHorshenin

12/03/2021 at 06:36PM

25
#162 - Ilay Skutelsky / @ISkutelsky

08/02/2022 at 06:11AM

25
#163 - Marco Meinardi / @chino_meinardi

12/29/2022 at 09:48PM

26
#164 - Munif Tanjim / @MunifTanjim

11/11/2020 at 08:01PM

26
#165 - MrRubiksSC / @RubiksSc

11/16/2020 at 01:32AM

26
#166 - James Lowenthal / @JamesAnthonyLow

11/22/2020 at 01:45AM

26
#167 - damned-me / @damned_me_

05/25/2021 at 05:44PM

26
#168 - Maorun / @Maorun11

06/30/2021 at 02:04PM

26
#169 - Hommels / @pseudohommels

10/26/2021 at 03:09AM

26
#170 - ややお / @yayaoh

12/24/2021 at 02:13AM

26
#171 - satetheus-vimgolf / @SVimgolf

07/24/2022 at 08:18AM

26
#172 - Andrii Soldatenko / @a_soldatenko

10/07/2022 at 09:39PM

26
#173 - Omar Alawadhi / @OmarAla59544225

10/09/2022 at 11:31AM

26
#174 - mindgitrwx / @mindgitrwx

12/06/2022 at 10:50AM

26
#175 - 0xdaydream / @0xdaydream_

01/11/2023 at 10:08AM

26
#176 - でよ / @tada_kun8

01/27/2023 at 03:47AM

27
#177 - Rafal C. / @RafalC37709324

11/14/2020 at 12:57PM

27
#178 - Matt DB / @MattDB12

12/06/2020 at 05:57PM

27
#179 - Eric Banisadr / @ebanisadr

12/13/2020 at 11:05AM

27
#180 - fray bauhaus / @BauhausFray

01/12/2021 at 12:38PM