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 172 remaining solutions by signing in and submitting your own entry
#173 Andrii Soldatenko / @a_soldatenko - Score: 143 - 11/16/20 @ 14:11
:<50-53>nnoremap <silent> gl "_yiw:s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/<CR><c-o>/\w\+\_W\+<CR><c-l><CR><Esc>[201~<CR><Right>gl<Up><Right><Right><Right><Right><Right><Right><Right><Right><Right>.gl<Right>gl<Right>glgl<Right>gl<Right><Right><Right><Right><Right>gl<Esc>:wq!<CR>

0 comments


Created by: @wedesoft

173 active golfers, 911 entries

Leaderboard (lowest score wins):
32
#121 - ‎ً / @zanzb

11/30/2020 at 07:11PM

32
#122 - Petru-Armand Bancila / @petruarmand

12/01/2020 at 06:36PM

32
#123 - nd183 / @nd1832

12/03/2020 at 12:25PM

32
#124 - justinhj / @justinhj

12/15/2020 at 06:55AM

32
#125 - yxke / @_yxke

01/14/2021 at 09:21AM

32
#126 - JingChen / @ilovejingle

01/18/2021 at 06:17AM

33
#127 - Riley John Gibbs / @RileyJohnGibbs

11/20/2020 at 11:35PM

33
#128 - Norman Liu / @normanwliu

12/06/2020 at 06:16AM

33
#129 - Bharath / @Bharath15952517

12/12/2020 at 03:04PM

34
#130 - Jonathan Ketner / @Chariotrunner

12/03/2020 at 01:46AM

34
#131 - said / @said13664960

12/16/2020 at 03:24PM

34
#132 - Marcin Dostojewski / @MarcinekAGH

01/10/2021 at 02:55PM

35
#133 - Tosoa Bacca / @elsifaka

11/10/2020 at 09:06AM

35
#134 - bladehaze / @bladehaze

12/09/2020 at 11:25PM

35
#135 - 正気・腕力・不労所得 / @tsukimizake774

12/19/2020 at 04:31PM

35
#136 - 김범준 / @kmbmjn

01/14/2021 at 06:13AM

37
#137 - jgoerner / @jgoerner2

11/11/2020 at 11:22PM

37
#138 - Leander Hendrikx / @leanderhendrikx

11/19/2020 at 01:13PM

37
#139 - dreamers00 / @dreamers003

11/23/2020 at 11:10AM

37
#140 - — / @Cenarius

12/07/2020 at 01:26AM

37
#141 - artisan bed maker / @ebencooke

12/16/2020 at 03:47AM

38
#142 - Jan Lukány / @Lukanyj

11/17/2020 at 12:41PM

39
#143 - Anil Narayan / @AnilNarayan2013

11/11/2020 at 04:49AM

39
#144 - Kitsan / @Strustle

11/22/2020 at 11:27AM

40
#145 - Jake Grossman / @PiranaLaugh

11/11/2020 at 04:54PM

40
#146 - Steffen / @Pions90

12/06/2020 at 03:07PM

40
#147 - kijete3127 / @kijete3127

12/13/2020 at 01:20PM

40
#148 - Danny T / @son_of_torkel

12/25/2020 at 04:05PM

42
#149 - ajay.vimgolf / @AjayVimgolf

11/11/2020 at 03:54PM

45
#150 - hejhopp87 / @hejhopp87

12/05/2020 at 08:11PM