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

338 active golfers, 1573 entries

Leaderboard (lowest score wins):
24
#61 - Don'tBeAlarmed / @DontBeAlarmed

05/31/2024 at 08:28PM

24
#62 - Peppa Pig / @PeppaPi95550250

07/14/2024 at 02:16AM

24
#63 - yexia0 / @yexia0

07/14/2024 at 09:14AM

24
#64 - nickGPT / @nickandbro

08/23/2024 at 02:50PM

25
#65 - Jean George / @JeanGeo20504212

07/16/2022 at 10:39AM

25
#66 - loupiot.veloce / @LoupiotVeloce

07/17/2022 at 03:23PM

25
#67 - wpr__ / @wpr____

07/19/2022 at 02:40PM

25
#68 - Lory / @Lory46845742

07/22/2022 at 03:07PM

25
#69 - GreenPinguin / @GreenPinguin2

07/26/2022 at 11:58AM

25
#70 - Eric Briand / @eric_briand

07/29/2022 at 01:58PM

25
#71 - Léo / @Leo58369183

08/22/2022 at 07:07AM

25
#72 - brett / @brettyukich

08/26/2022 at 03:57PM

25
#73 - 비비빅 / @bibibig80714274

09/05/2022 at 03:54PM

25
#74 - Jonny - Male 2.0.37 / @Jonnytron

09/15/2022 at 02:52PM

25
#75 - Julien Durillon / @juuduu

09/29/2022 at 05:03PM

25
#76 - Vlad Yaglamunov / @VladYaglamunov

10/12/2022 at 01:58PM

25
#77 - WladDalwM / @WladDalwM

10/13/2022 at 03:35PM

25
#78 - JongHwan Kim / @shockrabbit17

10/21/2022 at 12:30AM

25
#79 - Nathan Iszlaub / @NIszlaub

10/21/2022 at 03:53PM

25
#80 - おせよ / @OhSayYo

11/13/2022 at 09:09AM

25
#81 - Kha Nguyen / @__ngtrongkha

11/27/2022 at 04:06PM

25
#82 - Dank City / @ddankcity

12/01/2022 at 09:45PM

25
#83 - jajima / @jajima_jp

12/04/2022 at 10:47AM

25
#84 - Ivan Trepakov / @liontiger23

12/30/2022 at 03:20PM

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

02/04/2023 at 10:21PM

25
#86 - James Harvey / @JimmyJamesII

02/12/2023 at 12:03AM

25
#87 - John Huynh / @huynh_j93

02/13/2023 at 06:29PM

25
#88 - 蛙爹 / @Joe53572723

02/16/2023 at 07:59AM

25
#89 - Sergio / @SergioVl12

03/18/2023 at 06:55PM

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

03/22/2023 at 01:07AM