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

388 active golfers, 2128 entries

Leaderboard (lowest score wins):
53
#361 - salchint / @salchint

12/04/2020 at 04:46PM

53
#362 - Just Alerik / @Just_Alerik

12/15/2020 at 10:42PM

53
#363 - Jeremy Thompson / @jeremyt918

09/21/2021 at 11:26PM

55
#364 - Joe Farnsworth / @JoeFarnsworth

06/21/2021 at 09:31PM

56
#365 - sydman / @sydman11

11/18/2021 at 09:01AM

56
#366 - Christian Héon / @HeonCv

10/08/2022 at 04:06PM

58
#367 - Dennis Chen / @Mailyfesux

11/12/2020 at 05:18AM

59
#368 - dvorak4tzx / @dvorak4tzx4

12/28/2020 at 04:49PM

59
#369 - Kevin Linnane / @linnanekevin07

12/30/2020 at 10:01PM

59
#370 - iiooii / @APR_PLUS

12/31/2021 at 02:49AM

63
#371 - vr4vc4 / @vr4vc4

03/21/2022 at 07:25AM

64
#372 - Joshua Parco / @JoshuaParco2

11/09/2020 at 07:01PM

65
#373 - Yondonjamts Ganzorig / @yondonjamts_g

11/13/2020 at 11:30AM

67
#374 - monad / @skoblock

12/12/2020 at 05:04PM

67
#375 - SpadeAcademic / @AcademicSpade

01/15/2021 at 06:56AM

68
#376 - Chae Eon Lim / @ChaeEonLim1

06/13/2021 at 05:26AM

69
#377 - Harrison Morrow / @HJPMorrow

10/08/2022 at 10:18PM

72
#378 - Jacob Wood / @jacoblandonwood

06/15/2021 at 03:22AM

76
#379 - Malik Ouda / @malik_ouda

11/23/2020 at 07:36PM

78
#380 - danielchang2002 / @danielchang2002

12/07/2020 at 08:17PM

79
#381 - mathieu524287 / @mathieu524287

12/20/2020 at 11:52AM

81
#382 - 지형 유 / @O_hr_good7

04/05/2022 at 07:06PM

98
#383 - Prabhat Ranjan / @prabhatr27

11/29/2020 at 02:19PM

103
#384 - Parrth Pandey / @parrth1808

09/26/2022 at 04:09AM

107
#385 - Shinjini Ghosh / @ShinjiniGhosh00

12/03/2020 at 12:30AM

116
#386 - Khalin George / @Khalin_George

12/02/2020 at 06:42PM

116
#387 - 藤田拓郎 / @FujitaTakuro

05/23/2021 at 11:30AM

120
#388 - ahappyston1 / @ahappyston1

09/27/2024 at 10:32AM