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

348 active golfers, 1621 entries

Leaderboard (lowest score wins):
24
#31 - ᴄʜᴜǫᴜᴇʙᴇᴄᴏɪs / @deco__45

02/04/2023 at 10:26PM

24
#32 - DevilBb / @bb6_devil

02/09/2023 at 02:36AM

24
#33 - 黄高昂 / @suewiq

03/02/2023 at 02:06AM

24
#34 - bignos / @bignos2

03/20/2023 at 11:15AM

24
#35 - David Johnston / @nuts4nuts4nuts

03/24/2023 at 03:53AM

24
#36 - Glorbo / @GlorbyGlorbo

03/31/2023 at 06:08PM

24
#37 - FirstModus / @Nolimimer

04/08/2023 at 11:27AM

24
#38 - 陈俊池 / @calm_furious

04/09/2023 at 08:33PM

24
#39 - Koceto / @Koceto691735529

04/22/2023 at 01:21PM

24
#40 - jasonlee / @jasonle61136657

05/18/2023 at 10:28AM

24
#41 - わーお / @lwgZVRoOQ8Nf6VG

06/03/2023 at 05:54AM

24
#42 - Golf Vim / @GolfVim11388

07/02/2023 at 11:30PM

24
#43 - erik.forex / @ErikForex

07/07/2023 at 10:55AM

24
#44 - samuel erlands / @ErlandsSam52210

08/04/2023 at 12:38PM

24
#45 - moh ayaya / @AyayaMoh

08/15/2023 at 07:21PM

24
#46 - Vinny Diehl / @VinnyDiehl

09/15/2023 at 07:11AM

24
#47 - Monkey Boy / @monkey29089

09/22/2023 at 05:01AM

24
#48 - Laurens De la Marche / @LaurensDLM

10/19/2023 at 07:07PM

24
#49 - Paul Molloy / @paulsmolloy

10/19/2023 at 07:17PM

24
#50 - tien / @tien40766111

10/29/2023 at 09:59AM

24
#51 - Vimgolf User / @VimgolfU

11/15/2023 at 03:48PM

24
#52 - Henrique Malheiro / @rike09

11/17/2023 at 03:40PM

24
#53 - MonkieeBoi / @MonkieeBoi

11/22/2023 at 05:58AM

24
#54 - 悟史 / @A1OBJTxN5fTg5EJ

12/01/2023 at 05:28PM

24
#55 - Remus Dalrymple / @bornintheflames

12/11/2023 at 11:08AM

24
#56 - Leon Katsnelson / @leonkatsnelson

12/14/2023 at 05:49PM

24
#57 - Qing Liu / @poeminlash

01/01/2024 at 05:15AM

24
#58 - jeffreymrussell / @jeffreymrussell

01/23/2024 at 07:35PM

24
#59 - Chino / @MarcoMeinardi

03/15/2024 at 12:47PM

24
#60 - Aly Thobani / @alythobani

04/03/2024 at 12:26AM