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

349 active golfers, 1625 entries

Leaderboard (lowest score wins):
36
#241 - Godek Dominik / @dominik27182818

06/23/2023 at 10:03PM

36
#242 - Nick / @hobbnick

07/09/2023 at 06:39AM

37
#243 - Joey E / @GigachadJoe

07/20/2022 at 08:03AM

37
#244 - Ilay Skutelsky / @ISkutelsky

08/01/2022 at 09:41PM

37
#245 - ittk / @ittk_dev

10/20/2022 at 01:45PM

37
#246 - 赵火龙 / @P9srNn4b741jocf

12/08/2022 at 04:30PM

37
#247 - Heather Williams / @heathermweather

01/19/2023 at 04:13PM

37
#248 - fufuror / @futachima

01/26/2023 at 11:16AM

37
#249 - Ганц / @mishagantz

07/08/2023 at 04:07AM

37
#250 - ace / @PercyLixc

07/30/2023 at 04:31AM

37
#251 - Josh Pius / @josh-pius

10/01/2024 at 10:02AM

38
#252 - Blake Tereau / @BlakeTereau

08/21/2022 at 09:52PM

38
#253 - math is what I hate / @mpnmbn

08/23/2022 at 12:49PM

38
#254 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 10:42AM

38
#255 - K.Takao / @kit_tko

09/16/2022 at 03:44PM

38
#256 - steve / @steve35773420

11/09/2022 at 03:35AM

38
#257 - Nicholas Healy / @nickrhealy

12/21/2022 at 01:40PM

38
#258 - zoomhauer / @paulonhere

01/22/2023 at 12:53AM

38
#259 - brandjamie / @brandjamie

04/29/2023 at 09:47PM

38
#260 - b1gz / @_b1gz

06/30/2023 at 07:27PM

38
#261 - Tiago Nascimento / @tigum27

07/23/2023 at 10:04PM

39
#262 - potatol33t / @potatol33t

08/02/2022 at 09:46PM

39
#263 - Tommy Dew / @TommyDew5

08/30/2022 at 01:26PM

39
#264 - Yusuf AKIN / @zerdeshtjuan

09/20/2022 at 09:21PM

39
#265 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 09:05PM

39
#266 - Adrian Schultze / @adrianschultze

12/30/2022 at 03:39PM

39
#267 - Mohammed Raqeeb Shafeeque / @raqeebshafeeq

02/14/2023 at 06:10AM

39
#268 - Giacomo Sansone / @pcineverdies

07/05/2024 at 07:12PM

39
#269 - Alexandre GV. / @alexandregv

07/13/2024 at 04:24PM

40
#270 - Didik Hadumi Setiaji / @didik_hadumi

07/26/2022 at 03:25PM