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 311 remaining solutions by signing in and submitting your own entry
#312 陈宏义 / @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

312 active golfers, 1417 entries

Leaderboard (lowest score wins):
30
#181 - Michael Wiedfellner / @wiedfellne94556

09/13/2023 at 04:59PM

30
#182 - bpking1 / @bpking1

11/24/2023 at 01:02PM

31
#183 - ant0sha / @ant0shaR

05/30/2023 at 07:30PM

32
#184 - William Kennedy / @_williamkennedy

07/15/2022 at 01:55PM

32
#185 - alhegamu / @alhegamu

03/06/2023 at 07:19PM

32
#186 - 7733865@qq.com / @tjxwg

06/03/2023 at 07:54AM

32
#187 - Mohamad Abou Harb / @TwoShock

07/27/2023 at 01:43PM

33
#188 - sap / @sap38838304

09/15/2022 at 05:19AM

33
#189 - John Xu / @xzzhiao

09/16/2022 at 08:53AM

33
#190 - Mattias Fransson / @azzidoos

10/22/2022 at 10:04AM

33
#191 - Milan Blažek / @Somin13

09/05/2023 at 03:05PM

34
#192 - zuozuomu / @zuozuomu

07/30/2022 at 12:46AM

34
#193 - freebejan / @freebejan

08/09/2022 at 09:54PM

34
#194 - Abnermtj / @Abnerjr19

08/18/2022 at 05:34AM

34
#195 - Nicolas / @nick4tech

09/06/2022 at 08:12PM

34
#196 - funorange / @FunOrange42

06/13/2023 at 07:01PM

34
#197 - Kevin Wang / @VitamintK

12/29/2023 at 12:48AM

35
#198 - DeepArtic / @DeepArtic

07/21/2022 at 06:23PM

35
#199 - yann / @ylsarto

08/11/2022 at 01:50AM

35
#200 - Desentcare / @ashuyali

08/24/2022 at 07:01PM

35
#201 - damien / @GreatTestyTest

09/17/2022 at 08:41PM

35
#202 - sdfghjk / @sdfghjk88424595

02/16/2023 at 06:19PM

35
#203 - Yoshi Nets / @yoshinets

06/12/2023 at 11:02AM

35
#204 - Abdelrahman Madkour / @A3Madkour

07/25/2023 at 10:31PM

36
#205 - Guilherme Lima / @guilima10

08/09/2022 at 05:27PM

36
#206 - 阿部 / @l_abb

08/12/2022 at 07:27AM

36
#207 - winwinner / @winneratwin

08/15/2022 at 03:18PM

36
#208 - Avicenna / @avicenna1231

10/22/2022 at 03:24PM

36
#209 - Maciej Kalisiak / @MaciejKalisiak

11/01/2022 at 05:11AM

36
#210 - Me Tars / @me_tars

12/18/2022 at 09:52AM