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

183 active golfers, 955 entries

Leaderboard (lowest score wins):
39
#151 - Kitsan / @Strustle

11/22/2020 at 11:27AM

40
#152 - Jake Grossman / @PiranaLaugh

11/11/2020 at 04:54PM

40
#153 - Steffen / @Pions90

12/06/2020 at 03:07PM

40
#154 - kijete3127 / @kijete3127

12/13/2020 at 01:20PM

40
#155 - Danny T / @son_of_torkel

12/25/2020 at 04:05PM

40
#156 - Nishanth Reddy / @Nishanth2066

01/19/2021 at 05:21AM

40
#157 - Xiao Wangwang / @WangwangXiao

01/20/2021 at 06:04PM

40
#158 - Thomas Lüdecke / @t0mM3k

01/21/2021 at 12:43PM

42
#159 - ajay.vimgolf / @AjayVimgolf

11/11/2020 at 03:54PM

45
#160 - hejhopp87 / @hejhopp87

12/05/2020 at 08:11PM

46
#161 - Noise Official / @zmunk19

11/12/2020 at 08:33AM

46
#162 - Alex Kubica / @alexkubicail

11/12/2020 at 10:11AM

47
#163 - vesa / @XingfDu

01/08/2021 at 11:34AM

50
#164 - Bo Xie / @iebox

12/05/2020 at 03:52AM

50
#165 - りょー / @ryoo141

01/10/2021 at 03:20AM

51
#166 - just here to scroll. / @idontknow0001

11/15/2020 at 04:28PM

52
#167 - Ken Powers / @knpwrs

11/11/2020 at 03:25PM

53
#168 - salchint / @salchint

12/04/2020 at 04:46PM

53
#169 - Just Alerik / @Just_Alerik

12/15/2020 at 10:42PM

58
#170 - Dennis Chen / @Mailyfesux

11/12/2020 at 05:18AM

59
#171 - dvorak4tzx / @dvorak4tzx4

12/28/2020 at 04:49PM

59
#172 - Kevin Linnane / @linnanekevin07

12/30/2020 at 10:01PM

64
#173 - Joshua Parco / @JoshuaParco2

11/09/2020 at 07:01PM

65
#174 - Yondonjamts / @yondonjamts_g

11/13/2020 at 11:30AM

67
#175 - monad / @skoblock

12/12/2020 at 05:04PM

67
#176 - SpadeAcademic / @AcademicSpade

01/15/2021 at 06:56AM

76
#177 - Malik Ouda / @malik_ouda

11/23/2020 at 07:36PM

78
#178 - danielchang2002 / @danielchang2002

12/07/2020 at 08:17PM

79
#179 - mathieu524287 / @mathieu524287

12/20/2020 at 11:52AM

98
#180 - Prabhat Ranjan / @prabhatr27

11/29/2020 at 02:19PM