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):
17
#91 - Humbaba / @humbabu

12/31/2021 at 10:53PM

17
#92 - Youssef Magdy / @youssef_magdy29

05/01/2022 at 02:11AM

17
#93 - loupiot.veloce / @LoupiotVeloce

07/22/2022 at 08:53PM

17
#94 - z00master / @z00master

08/05/2022 at 05:12PM

17
#95 - monika gadage / @gadage_moni

09/24/2022 at 11:56PM

17
#96 - Vinicius Azevedo Pinheiro / @Viniciu42652081

10/10/2022 at 06:29AM

17
#97 - Nancho Alvarez / @nancho_alvarez

10/22/2022 at 02:18PM

17
#98 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 01:19PM

17
#99 - DW Luna / @dcheed_

12/21/2022 at 06:19AM

18
#100 - Ceda EI / @ceda_ei

11/10/2020 at 01:38PM

18
#101 - Saki Gw / @Sakigw

11/12/2020 at 02:06PM

18
#102 - David Kutschke / @D4KU_

11/12/2020 at 10:01PM

18
#103 - Andreas Siegrist / @andreaszwei

11/15/2020 at 12:33AM

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

11/15/2020 at 06:08PM

18
#105 - chocolate / @chocola81394123

11/18/2020 at 06:25AM

18
#106 - kse / @kse92733183

11/18/2020 at 04:01PM

18
#107 - ZackBurtAWS / @ZackBurtSDE

11/18/2020 at 04:10PM

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

11/18/2020 at 07:01PM

18
#109 - Tyler Holien / @tylerholien

11/19/2020 at 01:17AM

18
#110 - OtterPy / @OtterPy

01/26/2021 at 03:27PM

18
#111 - grsh / @girish_i_am

05/27/2021 at 08:07AM

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

10/09/2021 at 09:56PM

18
#113 - Jean George / @JeanGeo20504212

10/23/2021 at 11:36PM

18
#114 - Nils Melchert / @NilsMelchert

03/14/2022 at 03:33PM

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

06/15/2022 at 09:41PM

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

10/21/2022 at 09:38AM

19
#117 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 10:44AM

19
#118 - Björn Struckmeier / @BjrnStruckmeie1

01/03/2021 at 04:55PM

19
#119 - zapakh / @zapakh

01/21/2021 at 05:42AM

20
#120 - Demian Martinez / @demianuco

12/09/2020 at 06:13PM