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

322 active golfers, 1466 entries

Leaderboard (lowest score wins):
35
#211 - armaninux / @armaninux

04/04/2024 at 02:17PM

36
#212 - Guilherme Lima / @guilima10

08/09/2022 at 05:27PM

36
#213 - 阿部 / @l_abb

08/12/2022 at 07:27AM

36
#214 - winwinner / @winneratwin

08/15/2022 at 03:18PM

36
#215 - Avicenna / @avicenna1231

10/22/2022 at 03:24PM

36
#216 - Maciej Kalisiak / @MaciejKalisiak

11/01/2022 at 05:11AM

36
#217 - Me Tars / @me_tars

12/18/2022 at 09:52AM

36
#218 - @grhkm@infosec.exchange / @grhkm21

12/19/2022 at 01:55PM

36
#219 - iceylemon🌽 / @iceylemon157

02/09/2023 at 04:45AM

36
#220 - Aarya / @aaryabhatia6

05/20/2023 at 01:38AM

36
#221 - Godek Dominik / @dominik27182818

06/23/2023 at 10:03PM

36
#222 - Nick / @hobbnick

07/09/2023 at 06:39AM

37
#223 - Joey E / @GigachadJoe

07/20/2022 at 08:03AM

37
#224 - Ilay Skutelsky / @ISkutelsky

08/01/2022 at 09:41PM

37
#225 - ittk / @ittk_dev

10/20/2022 at 01:45PM

37
#226 - 赵火龙 / @P9srNn4b741jocf

12/08/2022 at 04:30PM

37
#227 - Heather Williams / @heathermweather

01/19/2023 at 04:13PM

37
#228 - fufuror / @futachima

01/26/2023 at 11:16AM

37
#229 - Ганц / @mishagantz

07/08/2023 at 04:07AM

37
#230 - ace / @PercyLixc

07/30/2023 at 04:31AM

38
#231 - Blake Tereau / @BlakeTereau

08/21/2022 at 09:52PM

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

08/23/2022 at 12:49PM

38
#233 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 10:42AM

38
#234 - K.Takao / @kit_tko

09/16/2022 at 03:44PM

38
#235 - steve / @steve35773420

11/09/2022 at 03:35AM

38
#236 - Nicholas Healy / @nickrhealy

12/21/2022 at 01:40PM

38
#237 - zoomhauer / @paulonhere

01/22/2023 at 12:53AM

38
#238 - brandjamie / @brandjamie

04/29/2023 at 09:47PM

38
#239 - b1gz / @_b1gz

06/30/2023 at 07:27PM

38
#240 - Tiago Nascimento / @tigum27

07/23/2023 at 10:04PM