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

339 active golfers, 1581 entries

Leaderboard (lowest score wins):
29
#181 - bonettimrc / @bonettimrc

04/27/2024 at 10:37PM

30
#182 - Austin Willliams / @GuitarMusash616

09/20/2022 at 03:25PM

30
#183 - 우정민 / @jeongmin2021

10/01/2022 at 03:19PM

30
#184 - Pheimors / @pheimors

10/02/2022 at 04:30PM

30
#185 - Bangash💉💉 / @DevotionGeo

10/08/2022 at 05:11AM

30
#186 - vimgolfaccfekxh / @vimgolfaccfekxh

10/22/2022 at 01:19AM

30
#187 - 김철호 / @Mx2W2

10/24/2022 at 02:00PM

30
#188 - Val / @Val07189123

10/25/2022 at 12:22PM

30
#189 - Gustavo C. Martins / @gustavocm

01/16/2023 at 12:51PM

30
#190 - Vinay Sridhar / @kewllip

03/20/2023 at 09:23AM

30
#191 - i just want to download stuff and not give my info / @rpgenespanish

04/14/2023 at 09:05PM

30
#192 - A. L. / @lnchk

07/26/2023 at 06:08PM

30
#193 - Dany L'Hebreux / @hebreux34582

08/06/2023 at 12:15PM

30
#194 - Divvy C. / @divvy_c

08/11/2023 at 03:42PM

30
#195 - Michael Wiedfellner / @wiedfellne94556

09/13/2023 at 04:59PM

30
#196 - bpking1 / @bpking1

11/24/2023 at 01:02PM

30
#197 - Lily / @totallyuniquelily

05/16/2024 at 10:39AM

31
#198 - ant0sha / @ant0shaR

05/30/2023 at 07:30PM

32
#199 - William Kennedy / @_williamkennedy

07/15/2022 at 01:55PM

32
#200 - alhegamu / @alhegamu

03/06/2023 at 07:19PM

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

06/03/2023 at 07:54AM

32
#202 - Mohamad Abou Harb / @TwoShock

07/27/2023 at 01:43PM

32
#203 - Pablo Acuna / @pacuna

09/13/2024 at 07:38AM

33
#204 - sap / @sap38838304

09/15/2022 at 05:19AM

33
#205 - John Xu / @xzzhiao

09/16/2022 at 08:53AM

33
#206 - Mattias Fransson / @azzidoos

10/22/2022 at 10:04AM

33
#207 - Milan Blažek / @Somin13

09/05/2023 at 03:05PM

34
#208 - zuozuomu / @zuozuomu

07/30/2022 at 12:46AM

34
#209 - freebejan / @freebejan

08/09/2022 at 09:54PM

34
#210 - Abnermtj / @Abnerjr19

08/18/2022 at 05:34AM