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

393 active golfers, 2169 entries

Leaderboard (lowest score wins):
16
#31 - pikjes / @pikjes2

07/14/2021 at 01:14PM

16
#32 - 悟史 / @A1OBJTxN5fTg5EJ

07/14/2021 at 02:06PM

16
#33 - lydxn / @lydxn1

07/28/2021 at 11:34PM

16
#34 - Hourann Lin / @HourannLin

08/05/2021 at 04:28PM

16
#35 - Roman Privalov / @RomanPrivalov

08/22/2021 at 02:42PM

16
#36 - yancy / @yancy_dong

09/16/2021 at 11:46AM

16
#37 - Benny Boy / @bennyboy999

10/03/2021 at 06:22AM

16
#38 - Tanzeel Kazi / @tanzeelkazi

10/19/2021 at 04:27PM

16
#39 - russellzhaomao / @russellzhaomao

05/19/2022 at 12:42AM

16
#40 - Xiaohuan Ye / @ikmijkk7

05/24/2022 at 05:18PM

16
#41 - redbigyesnoGoThenWhy / @redbigyesno

05/28/2022 at 07:24AM

16
#42 - Irakli Chigvaria / @tchigvaria

07/03/2022 at 07:27AM

16
#43 - Ariel Frischer / @ArielFrischer

07/17/2022 at 09:39PM

16
#44 - Janzen / @__Coos

09/13/2022 at 10:56AM

16
#45 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:22PM

16
#46 - math is what I hate / @mpnmbn

09/20/2022 at 06:22PM

16
#47 - 刘宏亮 / @AkeyCoy

09/21/2022 at 01:45PM

16
#48 - Jay R / @RonatinJ

09/25/2022 at 08:33PM

16
#49 - chen chaos / @chenchaos3

10/11/2022 at 06:27AM

16
#50 - ky05uk3 / @kyo89347563

12/03/2022 at 01:25PM

16
#51 - Zion Park / @zionpark93

12/11/2022 at 08:48PM

16
#52 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 10:18PM

16
#53 - ColdBear / @ColdBear11

12/17/2022 at 02:29PM

16
#54 - Ted / @TodorDukov

03/13/2023 at 04:47PM

16
#55 - 李建宏 / @xx19971016

08/31/2023 at 08:19AM

16
#56 - satake0916 / @satake0916

01/02/2024 at 12:42AM

16
#57 - Aly Thobani / @alythobani

05/29/2024 at 04:52AM

16
#58 - Peppa Pig / @PeppaPigSg

07/15/2024 at 09:06AM

16
#59 - Pim / @Pireax

11/07/2024 at 11:56PM

16
#60 - winter-loo / @winter-loo

07/29/2025 at 05:25AM