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

322 active golfers, 1466 entries

Leaderboard (lowest score wins):
25
#61 - Jean George / @JeanGeo20504212

07/16/2022 at 10:39AM

25
#62 - loupiot.veloce / @LoupiotVeloce

07/17/2022 at 03:23PM

25
#63 - wpr__ / @wpr____

07/19/2022 at 02:40PM

25
#64 - Lory / @Lory46845742

07/22/2022 at 03:07PM

25
#65 - GreenPinguin / @GreenPinguin2

07/26/2022 at 11:58AM

25
#66 - Eric Briand / @eric_briand

07/29/2022 at 01:58PM

25
#67 - Léo / @Leo58369183

08/22/2022 at 07:07AM

25
#68 - brett / @brettyukich

08/26/2022 at 03:57PM

25
#69 - 비비빅 / @bibibig80714274

09/05/2022 at 03:54PM

25
#70 - Jonny / @Jonnytron

09/15/2022 at 02:52PM

25
#71 - Julien Durillon / @juuduu

09/29/2022 at 05:03PM

25
#72 - Vlad Yaglamunov / @VladYaglamunov

10/12/2022 at 01:58PM

25
#73 - WladDalwM / @WladDalwM

10/13/2022 at 03:35PM

25
#74 - JongHwan Kim / @shockrabbit17

10/21/2022 at 12:30AM

25
#75 - Nathan Iszlaub / @NIszlaub

10/21/2022 at 03:53PM

25
#76 - おせよ / @OhSayYo

11/13/2022 at 09:09AM

25
#77 - Kha Nguyen / @__ngtrongkha

11/27/2022 at 04:06PM

25
#78 - Dank City / @ddankcity

12/01/2022 at 09:45PM

25
#79 - jajima / @jajima_jp

12/04/2022 at 10:47AM

25
#80 - Ivan Trepakov / @liontiger23

12/30/2022 at 03:20PM

25
#81 - макар бананович / @babnanbab

02/04/2023 at 10:21PM

25
#82 - James Harvey / @JimmyJamesII

02/12/2023 at 12:03AM

25
#83 - John Huynh / @huynh_j93

02/13/2023 at 06:29PM

25
#84 - 蛙爹 / @Joe53572723

02/16/2023 at 07:59AM

25
#85 - Sergio / @SergioVl12

03/18/2023 at 06:55PM

25
#86 - ­김수현 / 학생 / 건설환경공학부 / @gimsuhyeonhags1

03/22/2023 at 01:07AM

25
#87 - Francois Marais / @maraisf

04/04/2023 at 06:15PM

25
#88 - Jordan Woods / @JordanW09204552

06/10/2023 at 12:07AM

25
#89 - someperson150 / @someperson150

06/10/2023 at 05:54AM

25
#90 - Игорь Квачёнок / @IKvacenok

06/11/2023 at 05:21PM