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

348 active golfers, 1621 entries

Leaderboard (lowest score wins):
40
#271 - Matilda Amy / @Matilda_Amy2

04/03/2023 at 08:09PM

40
#272 - Sumanth Yedoti / @sumanthyedoti

05/25/2023 at 06:27PM

40
#273 - daniilsvirin / @daniilsvirin

10/15/2024 at 09:16AM

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

09/11/2022 at 03:14PM

41
#275 - Bent / @BHochrad

11/04/2022 at 01:34PM

41
#276 - Mehrdad Abdi / @newmrd

12/01/2022 at 08:27AM

41
#277 - djheidihoe / @djheidihoe1

12/20/2022 at 03:59PM

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

01/24/2023 at 05:28PM

41
#279 - Tunian Grey / @salmonianpink

02/26/2023 at 11:07AM

41
#280 - Aristotelis Dossas / @teldosas

03/24/2024 at 06:19PM

41
#281 - lejeunel / @lejeunel

04/04/2024 at 02:03PM

42
#282 - Jay Sepkus / @AngrySpongeFace

09/16/2022 at 09:56AM

42
#283 - Victor Tortolero / @MightyPenguinV

01/05/2023 at 07:16PM

42
#284 - stablestud / @stablestud1

05/15/2023 at 04:03PM

42
#285 - Erick Gonzalez / @eygl_erick

06/10/2023 at 01:37PM

42
#286 - dakmuk / @yeongha_yang

07/07/2023 at 01:19AM

42
#287 - Victor Phan / @Victor_Phan

08/31/2023 at 01:11AM

42
#288 - Flimsy Giraffe / @flimsy_giraffe

10/05/2023 at 07:30PM

42
#289 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

03/08/2024 at 01:07PM

43
#290 - Mika Dede / @xerv0n

09/02/2022 at 04:01AM

43
#291 - Agustin Romero / @agus_piojo

09/23/2022 at 12:58AM

43
#292 - jon smith / @jotono91472250

03/04/2023 at 03:42PM

43
#293 - Joachim Nielandt / @JoachimNielandt

05/22/2023 at 09:02AM

43
#294 - Ashley Feniello / @AshleyFen

01/02/2024 at 07:47AM

44
#295 - Nikita / @nikitajz

09/18/2022 at 07:22PM

44
#296 - Nicolas / @martinni39

09/25/2022 at 06:18AM

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

02/01/2023 at 04:53PM

44
#298 - Adrián Fidalgo-Díaz / @adrianFD22

12/15/2023 at 05:39PM

44
#299 - Leandro / @leandrochiarini

02/29/2024 at 06:58PM

45
#300 - Sarang Khim / @sarang_khim

07/27/2022 at 07:08AM