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


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

336 active golfers, 1817 entries

Leaderboard (lowest score wins):
30
#211 - Nougatine Naja / @NougatineNaja

01/03/2022 at 03:11PM

30
#212 - NicolasWebDev / @NicolasWebDev

04/26/2022 at 08:17PM

30
#213 - Himanshu Tank / @himanshutank75

10/29/2022 at 04:14PM

30
#214 - Jay Solana / @JaySolana3

02/07/2023 at 06:16AM

31
#215 - rr / @rodgeur31

11/09/2020 at 06:55PM

31
#216 - dreamers00 / @dreamers003

01/23/2021 at 10:34PM

32
#217 - Jan Wedekind / @wedesoft

11/09/2020 at 03:40PM

32
#218 - Harry Uzzell / @HarryMUzzell

11/09/2020 at 03:42PM

32
#219 - Mike Harris / @MikeMJHarris

11/10/2020 at 09:23AM

32
#220 - Jakub / @vr0m

11/11/2020 at 07:51PM

32
#221 - Akkarin / @akkarinka

11/15/2020 at 12:56PM

32
#222 - David / @imdavidhwang

11/16/2020 at 05:31PM

32
#223 - なんとなく鍛えたい気分 / @VpFvUt2dq2BLepg

11/19/2020 at 11:02AM

32
#224 - __VimGolfer__ / @VimGolfer19

11/30/2020 at 11:56AM

32
#225 - ‎ً / @zanzb

11/30/2020 at 07:11PM

32
#226 - Petru-Armand Bancila / @petruarmand

12/01/2020 at 06:36PM

32
#227 - nd183 / @nd1832

12/03/2020 at 12:25PM

32
#228 - justinhj / @justinhj

12/15/2020 at 06:55AM

32
#229 - yxke / @_yxke

01/14/2021 at 09:21AM

32
#230 - JingChen / @ilovejingle

01/18/2021 at 06:17AM

32
#231 - Josh Swift / @Swiftyfish14

01/26/2021 at 06:00PM

32
#232 - Sylvain Dangin / @Sylvaner03

05/18/2021 at 07:21PM

32
#233 - Ryan Cleary / @ry_guy41

12/14/2021 at 01:06AM

32
#234 - Simon / @mopsdiv

12/14/2021 at 10:19PM

32
#235 - Ken / @kenc_

01/20/2022 at 06:46AM

32
#236 - 우정민 / @jeongmin2021

10/02/2022 at 07:58PM

32
#237 - Yāsky / @Yaasky

01/17/2023 at 07:55PM

33
#238 - Riley John Gibbs / @RileyJohnGibbs

11/20/2020 at 11:35PM

33
#239 - Norman Liu / @normanwliu

12/06/2020 at 06:16AM

33
#240 - Bharath / @Bharath15952517

12/12/2020 at 03:04PM