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 9v0062d0773d000000000225

Reformat symbols in list

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

Start file
inputs = [ 1 2 3 4 5 ]
outputs = [ 1 2 3 4 5 ]
End file
inputs = [ i1 i2 i3 i4 i5 ]
outputs = [ (o1,i1) (o2,i2) (o3,i3) (o4,i4) (o5,i5) ]

View Diff

1,2c1,2
< inputs = [ 1 2 3 4 5 ]
< outputs = [ 1 2 3 4 5 ]
---
> inputs = [ i1 i2 i3 i4 i5 ]
> outputs = [ (o1,i1) (o2,i2) (o3,i3) (o4,i4) (o5,i5) ]

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 150 remaining solutions by signing in and submitting your own entry
#151 陈宏义 / @mason_chen_cn - Score: 202 - 09/12/22 @ 15:29
<Esc>:1,1s/[]<Left>0<BS>1-5<Right><Left><Left><Left><Left><Left>(<Right><Right><Right><Right><Right>)/i$1/g<CR>/<BS>:1s/([1-5]+)/i()<BS><BS>1<BS>$1.g<CR>/[]<Left>1-5<CR>nnnnnnnnn:s<BS>1,1s/[1-5]/i[]<Left>1-5<Right>/g<CR><Esc>u:s/<BS><BS>1s/[1-5]/$<Left><Left><Left><Left><Left><Left><Left>\(<Right><Right><Right><Right><Right>\)<Right><Right><BS>i\1/g<CR>s/<BS>i<Esc>:2s<BS>,<BS>s/\(1-5<Left><Left><Left>[<Right><Right><Right>]\)/\[<BS><BS>(o\1,i\1)/g<CR>`;<Esc><Esc>:w<CR>:q!<CR>

0 comments


Created by: @selfuryon

151 active golfers, 668 entries

Leaderboard (lowest score wins):
27
#61 - Omar Alawadhi / @OmarAla59544225

09/10/2022 at 07:25PM

27
#62 - Funky McBeef / @FunkyMcBeef

09/12/2022 at 02:37PM

27
#63 - Kevin Chen / @kevkevchen

09/18/2022 at 06:39AM

27
#64 - キムラ・OPEL・ユウジ / @kimurayuuji79

09/21/2022 at 03:36AM

27
#65 - Chris AtLee / @chrisatlee

09/25/2022 at 09:15PM

27
#66 - Nikolaj Sidorenco / @nikolajdws

09/29/2022 at 12:58PM

27
#67 - Opposite Invictus / @OppositeInvict2

10/07/2022 at 07:52PM

27
#68 - Nancho Alvarez / @nancho_alvarez

10/25/2022 at 12:09AM

27
#69 - Andrii Romashchenko / @aromarom64

10/25/2022 at 06:18PM

27
#70 - jimmarq / @jimmarq

10/28/2022 at 08:57PM

27
#71 - Mantas Pilipuitis / @MPilipuitis

11/01/2022 at 11:16AM

27
#72 - Gs Abl / @gs_abl

11/27/2022 at 09:30AM

27
#73 - Lars Winderling / @kaHaleMaKai

11/29/2022 at 07:27PM

27
#74 - MC / @MC88686523

12/01/2022 at 05:04PM

27
#75 - Dany L'Hébreux / @dlhebreux

12/02/2022 at 03:00AM

28
#76 - Johan Arrhen / @JoPeArrhen

09/24/2022 at 12:38PM

28
#77 - Laughing Cavalier / @jovial_cavalier

10/26/2022 at 03:32PM

29
#78 - Nougatine Naja / @NougatineNaja

07/26/2022 at 12:46PM

29
#79 - vuems / @vuems2win

11/11/2022 at 12:57AM

29
#80 - Kieron Browne / @KieronBrowne1

11/21/2022 at 08:58PM

30
#81 - Austin Willliams / @GuitarMusash616

09/20/2022 at 03:25PM

30
#82 - 우정민 / @jeongmin2021

10/01/2022 at 03:19PM

30
#83 - Pheimors / @pheimors

10/02/2022 at 04:30PM

30
#84 - Bangash💉💉 / @DevotionGeo

10/08/2022 at 05:11AM

30
#85 - vimgolfaccfekxh / @vimgolfaccfekxh

10/22/2022 at 01:19AM

30
#86 - 김철호 / @Mx2W2

10/24/2022 at 02:00PM

30
#87 - Val / @Val07189123

10/25/2022 at 12:22PM

32
#88 - William Kennedy / @_williamkennedy

07/15/2022 at 01:55PM

33
#89 - sap / @sap38838304

09/15/2022 at 05:19AM

33
#90 - John Xu / @xzzhiao

09/16/2022 at 08:53AM