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


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

333 active golfers, 1809 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

17
#54 - Jon Krause / @jkrause314

11/09/2020 at 10:16PM

17
#55 - Ansel Bobrow / @garlicWharfRat

11/10/2020 at 04:32AM

17
#56 - Smylers / @Smylers2

11/10/2020 at 11:04AM

17
#57 - Ricardo Lima / @ricponteslima

11/10/2020 at 05:18PM

17
#58 - Jacques Donnelly / @Donnll

11/10/2020 at 09:27PM

17
#59 - Filipe Brandenburger / @filbranden

11/10/2020 at 11:52PM

17
#60 - Leo / @badangos

11/12/2020 at 08:22AM