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

327 active golfers, 1477 entries

Leaderboard (lowest score wins):
38
#241 - zoomhauer / @paulonhere

01/22/2023 at 12:53AM

38
#242 - brandjamie / @brandjamie

04/29/2023 at 09:47PM

38
#243 - b1gz / @_b1gz

06/30/2023 at 07:27PM

38
#244 - Tiago Nascimento / @tigum27

07/23/2023 at 10:04PM

39
#245 - potatol33t / @potatol33t

08/02/2022 at 09:46PM

39
#246 - Tommy Dew / @TommyDew5

08/30/2022 at 01:26PM

39
#247 - Yusuf AKIN / @zerdeshtjuan

09/20/2022 at 09:21PM

39
#248 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 09:05PM

39
#249 - Adrian Schultze / @adrianschultze

12/30/2022 at 03:39PM

39
#250 - Mohammed Raqeeb Shafeeque / @raqeebshafeeq

02/14/2023 at 06:10AM

40
#251 - Didik Hadumi Setiaji / @didik_hadumi

07/26/2022 at 03:25PM

40
#252 - Manas / @weirdsmiley_

10/23/2022 at 04:55PM

40
#253 - Matilda Amy / @Matilda_Amy2

04/03/2023 at 08:09PM

40
#254 - Sumanth Yedoti / @sumanthyedoti

05/25/2023 at 06:27PM

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

09/11/2022 at 03:14PM

41
#256 - Bent / @BHochrad

11/04/2022 at 01:34PM

41
#257 - Mehrdad Abdi / @newmrd

12/01/2022 at 08:27AM

41
#258 - djheidihoe / @djheidihoe1

12/20/2022 at 03:59PM

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

01/24/2023 at 05:28PM

41
#260 - Tunian Grey / @salmonianpink

02/26/2023 at 11:07AM

41
#261 - Aristotelis Dossas / @teldosas

03/24/2024 at 06:19PM

41
#262 - lejeunel / @lejeunel

04/04/2024 at 02:03PM

42
#263 - Jay Sepkus / @AngrySpongeFace

09/16/2022 at 09:56AM

42
#264 - Victor Tortolero / @MightyPenguinV

01/05/2023 at 07:16PM

42
#265 - stablestud / @stablestud1

05/15/2023 at 04:03PM

42
#266 - Erick Gonzalez / @eygl_erick

06/10/2023 at 01:37PM

42
#267 - dakmuk / @yeongha_yang

07/07/2023 at 01:19AM

42
#268 - Victor Phan / @Victor_Phan

08/31/2023 at 01:11AM

42
#269 - Flimsy Giraffe / @flimsy_giraffe

10/05/2023 at 07:30PM

42
#270 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

03/08/2024 at 01:07PM