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

210 active golfers, 901 entries

Leaderboard (lowest score wins):
38
#151 - Nicholas Healy / @nickrhealy

12/21/2022 at 01:40PM

38
#152 - Tony Fungus (read pinned) / @brrsty

01/22/2023 at 12:53AM

39
#153 - potatol33t / @potatol33t

08/02/2022 at 09:46PM

39
#154 - Tommy Dew / @TommyDew5

08/30/2022 at 01:26PM

39
#155 - Yusuf AKIN / @zerdeshtjuan

09/20/2022 at 09:21PM

39
#156 - Matthew Finlayson / @mattf1n

10/18/2022 at 03:05PM

39
#157 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 09:05PM

39
#158 - Adrian Schultze / @adrianschultze

12/30/2022 at 03:39PM

39
#159 - Mohammed Raqeeb Shafeeque / @raqeebshafeeq

02/14/2023 at 06:10AM

40
#160 - Didik Hadumi Setiaji / @didik_hadumi

07/26/2022 at 03:25PM

40
#161 - Manas / @weirdsmiley_

10/23/2022 at 04:55PM

41
#162 - Abdelrahman Madkour / @A3Madkour

08/12/2022 at 09:11PM

41
#163 - Dr. Peťko / @PetkoDr

09/11/2022 at 03:14PM

41
#164 - Bent / @BHochrad

11/04/2022 at 01:34PM

41
#165 - Mehrdad Abdi / @newmrd

12/01/2022 at 08:27AM

41
#166 - djheidihoe / @djheidihoe1

12/20/2022 at 03:59PM

41
#167 - Al-Baraa El-Hag / @drskoolie

01/24/2023 at 05:28PM

41
#168 - Tunian Grey / @salmonianpink

02/26/2023 at 11:07AM

42
#169 - Jay Sepkus / @AngrySpongeFace

09/16/2022 at 09:56AM

42
#170 - Victor Tortolero / @MightyPenguinV

01/05/2023 at 07:16PM

43
#171 - Mika Dede / @xerv0n

09/02/2022 at 04:01AM

43
#172 - Agustin Romero / @agus_piojo

09/23/2022 at 12:58AM

43
#173 - jon smith / @jotono91472250

03/04/2023 at 03:42PM

44
#174 - Nikita / @nikitajz

09/18/2022 at 07:22PM

44
#175 - Nicolas / @martinni39

09/25/2022 at 06:18AM

44
#176 - ⚫ hgtp://Shifor 🛠️ / @shifor_gnome

02/01/2023 at 04:53PM

44
#177 - jasonlee / @jasonle61136657

03/14/2023 at 07:40AM

45
#178 - Aarya / @aaryabhatia6

07/17/2022 at 05:33AM

45
#179 - Sarang Khim / @sarang_khim

07/27/2022 at 07:08AM

45
#180 - D G G / @DGJourneyman

02/20/2023 at 09:07AM