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):
33
#91 - Mattias Fransson / @azzidoos

10/22/2022 at 10:04AM

34
#92 - zuozuomu / @zuozuomu

07/30/2022 at 12:46AM

34
#93 - freebejan / @freebejan

08/09/2022 at 09:54PM

34
#94 - Abnermtj / @Abnerjr19

08/18/2022 at 05:34AM

34
#95 - Nicolas / @nick4tech

09/06/2022 at 08:12PM

35
#96 - DeepArtic / @DeepArtic

07/21/2022 at 06:23PM

35
#97 - yann / @ylsarto

08/11/2022 at 01:50AM

35
#98 - Desentcare / @ashuyali

08/24/2022 at 07:01PM

35
#99 - damien / @GreatTestyTest

09/17/2022 at 08:41PM

36
#100 - Guilherme Lima / @guilima10

08/09/2022 at 05:27PM

36
#101 - 阿部 / @l_abb

08/12/2022 at 07:27AM

36
#102 - winwinner / @winneratwin

08/15/2022 at 03:18PM

36
#103 - Avicenna / @avicenna1231

10/22/2022 at 03:24PM

36
#104 - Maciej Kalisiak / @MaciejKalisiak

11/01/2022 at 05:11AM

37
#105 - Joey E / @GigachadJoe

07/20/2022 at 08:03AM

37
#106 - Ilay Skutelsky / @ISkutelsky

08/01/2022 at 09:41PM

37
#107 - ittk / @ittk_dev

10/20/2022 at 01:45PM

38
#108 - Blake Tereau / @BlakeTereau

08/21/2022 at 09:52PM

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

08/23/2022 at 12:49PM

38
#110 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 10:42AM

38
#111 - K.Takao / @kit_tko

09/16/2022 at 03:44PM

38
#112 - steve / @steve35773420

11/09/2022 at 03:35AM

39
#113 - potatol33t / @potatol33t

08/02/2022 at 09:46PM

39
#114 - Tommy Dew / @TommyDew5

08/30/2022 at 01:26PM

39
#115 - Yusuf AKIN / @zerdeshtjuan

09/20/2022 at 09:21PM

39
#116 - Matthew Finlayson / @mattf1n

10/18/2022 at 03:05PM

40
#117 - Didik Hadumi Setiaji / @didik_hadumi

07/26/2022 at 03:25PM

40
#118 - Manas / @weirdsmiley_

10/23/2022 at 04:55PM

41
#119 - Abdelrahman Madkour / @A3Madkour

08/12/2022 at 09:11PM

41
#120 - Dr. Peťko / @PetkoDr

09/11/2022 at 03:14PM