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):
33
#211 - sap / @sap38838304

09/15/2022 at 05:19AM

33
#212 - John Xu / @xzzhiao

09/16/2022 at 08:53AM

33
#213 - Mattias Fransson / @azzidoos

10/22/2022 at 10:04AM

33
#214 - Milan Blažek / @Somin13

09/05/2023 at 03:05PM

34
#215 - zuozuomu / @zuozuomu

07/30/2022 at 12:46AM

34
#216 - freebejan / @freebejan

08/09/2022 at 09:54PM

34
#217 - Abnermtj / @Abnerjr19

08/18/2022 at 05:34AM

34
#218 - Nicolas / @nick4tech

09/06/2022 at 08:12PM

34
#219 - funorange / @FunOrange42

06/13/2023 at 07:01PM

34
#220 - Kevin Wang / @VitamintK

12/29/2023 at 12:48AM

34
#221 - Diwakar Singh Parmar / @parmardiwakar150

08/25/2024 at 05:33PM

35
#222 - DeepArtic / @DeepArtic

07/21/2022 at 06:23PM

35
#223 - yann / @ylsarto

08/11/2022 at 01:50AM

35
#224 - Desentcare / @ashuyali

08/24/2022 at 07:01PM

35
#225 - damien / @GreatTestyTest

09/17/2022 at 08:41PM

35
#226 - sdfghjk / @sdfghjk88424595

02/16/2023 at 06:19PM

35
#227 - Yoshi Nets / @yoshinets

06/12/2023 at 11:02AM

35
#228 - Abdelrahman Madkour / @A3Madkour

07/25/2023 at 10:31PM

35
#229 - Charlie / @charliezchen

03/28/2024 at 02:47AM

35
#230 - armaninux / @armaninux

04/04/2024 at 02:17PM

35
#231 - Alex Elarbee / @elarbee

09/22/2024 at 07:35PM

36
#232 - Guilherme Lima / @guilima10

08/09/2022 at 05:27PM

36
#233 - 阿部 / @l_abb

08/12/2022 at 07:27AM

36
#234 - winwinner / @winneratwin

08/15/2022 at 03:18PM

36
#235 - Avicenna / @avicenna1231

10/22/2022 at 03:24PM

36
#236 - Maciej Kalisiak / @MaciejKalisiak

11/01/2022 at 05:11AM

36
#237 - Me Tars / @me_tars

12/18/2022 at 09:52AM

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

12/19/2022 at 01:55PM

36
#239 - iceylemon🌽 / @iceylemon157

02/09/2023 at 04:45AM

36
#240 - Aarya / @aaryabhatia6

05/20/2023 at 01:38AM