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):
24
#1 - Jon Krause / @jkrause314

07/19/2022 at 04:41AM

24
#2 - Saki Gw / @Sakigw

07/19/2022 at 04:51PM

24
#3 - Andrew Morris / @andrew_morris

07/19/2022 at 11:08PM

24
#4 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

07/22/2022 at 07:26AM

24
#5 - Александр Черенков / @AleksandrCeren3

07/23/2022 at 01:23AM

24
#6 - Irakli Chigvaria / @tchigvaria

07/25/2022 at 10:05AM

24
#7 - John Braxler / @braxler

07/25/2022 at 03:17PM

24
#8 - fraktal / @FraktalRebirth

07/27/2022 at 08:16AM

24
#9 - xvczuwo / @xvczuwoa

08/01/2022 at 07:21PM

24
#10 - quemeraisc / @quemeraisc

08/09/2022 at 12:21PM

24
#11 - Sahar Rachamim (Kishu) / @SRachamim

08/13/2022 at 03:01PM

24
#12 - Hugh / @haquaman

08/19/2022 at 12:54AM

24
#13 - Alex / @AlexanderHeatl2

08/21/2022 at 06:18PM

24
#14 - 'ymdarake / @ymdarake

08/22/2022 at 02:05PM

24
#15 - jeayong Cho / @JeayongC

08/25/2022 at 04:42AM

24
#16 - vimgolfer220902 / @vimgolfer220902

09/03/2022 at 05:04PM

24
#17 - Eivind Jahren / @HaskellElephant

09/11/2022 at 06:52PM

24
#18 - Alex Lewin / @_AlexLewin

09/20/2022 at 03:24PM

24
#19 - vimgolf / @LearnVimGolf

09/26/2022 at 02:06PM

24
#20 - kulabun / @kulabun

09/28/2022 at 06:47AM

24
#21 - Janzen / @__Coos

10/07/2022 at 05:42AM

24
#22 - Suxpert / @LiTuX_S

10/09/2022 at 09:20AM

24
#23 - t leish / @tleish

10/11/2022 at 03:40AM

24
#24 - Topvimgolf Score / @topvimgolfscore

10/12/2022 at 09:49AM

24
#25 - ky05uk3 / @kyo89347563

11/21/2022 at 02:01AM

24
#26 - Ekalos / @_Ekalos

11/26/2022 at 07:04AM

24
#27 - yurei / @yurei38667012

12/14/2022 at 01:26PM

24
#28 - Zion Park / @zionpark93

12/14/2022 at 07:00PM

24
#29 - DW Luna / @dcheed_

12/24/2022 at 07:17PM

24
#30 - test-and-sun / @testandsun1

01/20/2023 at 02:33PM