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


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

340 active golfers, 1838 entries

Leaderboard (lowest score wins):
72
#331 - Jacob Wood / @jacoblandonwood

06/15/2021 at 03:22AM

76
#332 - Malik Ouda / @malik_ouda

11/23/2020 at 07:36PM

78
#333 - danielchang2002 / @danielchang2002

12/07/2020 at 08:17PM

79
#334 - mathieu524287 / @mathieu524287

12/20/2020 at 11:52AM

81
#335 - 지형 유 / @O_hr_good7

04/05/2022 at 07:06PM

98
#336 - Prabhat Ranjan / @prabhatr27

11/29/2020 at 02:19PM

103
#337 - Parrth Pandey / @parrth1808

09/26/2022 at 04:09AM

107
#338 - Shinjini Ghosh / @ShinjiniGhosh00

12/03/2020 at 12:30AM

116
#339 - Khalin George / @Khalin_George

12/02/2020 at 06:42PM

116
#340 - 藤田拓郎 / @FujitaTakuro

05/23/2021 at 11:30AM