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):
29
#181 - KyuYoung Heo / @bbvch13531

01/13/2023 at 04:21AM

29
#182 - 马海洋 / @LG41bT7ZvqOdFl3

02/07/2023 at 03:34AM

29
#183 - rstcruzo / @rstcruzo

03/05/2023 at 06:51AM

29
#184 - Selvaganapathy P / @canabady

04/10/2023 at 02:22PM

29
#185 - Egor Voronov / @do_syscall_64

05/25/2023 at 05:29PM

29
#186 - wemgulf / @wemgulfer

11/02/2023 at 12:27PM

29
#187 - Daniel Allen / @danielgallen

01/13/2024 at 04:35PM

29
#188 - bonettimrc / @bonettimrc

04/27/2024 at 10:37PM

30
#189 - Austin Willliams / @GuitarMusash616

09/20/2022 at 03:25PM

30
#190 - 우정민 / @jeongmin2021

10/01/2022 at 03:19PM

30
#191 - Pheimors / @pheimors

10/02/2022 at 04:30PM

30
#192 - Bangash💉💉 / @DevotionGeo

10/08/2022 at 05:11AM

30
#193 - vimgolfaccfekxh / @vimgolfaccfekxh

10/22/2022 at 01:19AM

30
#194 - 김철호 / @Mx2W2

10/24/2022 at 02:00PM

30
#195 - Val / @Val07189123

10/25/2022 at 12:22PM

30
#196 - Gustavo C. Martins / @gustavocm

01/16/2023 at 12:51PM

30
#197 - Vinay Sridhar / @kewllip

03/20/2023 at 09:23AM

30
#198 - i just want to download stuff and not give my info / @rpgenespanish

04/14/2023 at 09:05PM

30
#199 - A. L. / @lnchk

07/26/2023 at 06:08PM

30
#200 - Dany L'Hebreux / @hebreux34582

08/06/2023 at 12:15PM

30
#201 - Divvy C. / @divvy_c

08/11/2023 at 03:42PM

30
#202 - Michael Wiedfellner / @wiedfellne94556

09/13/2023 at 04:59PM

30
#203 - bpking1 / @bpking1

11/24/2023 at 01:02PM

30
#204 - Lily / @totallyuniquelily

05/16/2024 at 10:39AM

31
#205 - ant0sha / @ant0shaR

05/30/2023 at 07:30PM

32
#206 - William Kennedy / @_williamkennedy

07/15/2022 at 01:55PM

32
#207 - alhegamu / @alhegamu

03/06/2023 at 07:19PM

32
#208 - 7733865@qq.com / @tjxwg

06/03/2023 at 07:54AM

32
#209 - Mohamad Abou Harb / @TwoShock

07/27/2023 at 01:43PM

32
#210 - Pablo Acuna / @pacuna

09/13/2024 at 07:38AM