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

326 active golfers, 1476 entries

Leaderboard (lowest score wins):
43
#271 - Mika Dede / @xerv0n

09/02/2022 at 04:01AM

43
#272 - Agustin Romero / @agus_piojo

09/23/2022 at 12:58AM

43
#273 - jon smith / @jotono91472250

03/04/2023 at 03:42PM

43
#274 - Joachim Nielandt / @JoachimNielandt

05/22/2023 at 09:02AM

43
#275 - Ashley Feniello / @AshleyFen

01/02/2024 at 07:47AM

44
#276 - Nikita / @nikitajz

09/18/2022 at 07:22PM

44
#277 - Nicolas / @martinni39

09/25/2022 at 06:18AM

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

02/01/2023 at 04:53PM

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

12/15/2023 at 05:39PM

44
#280 - Leandro / @leandrochiarini

02/29/2024 at 06:58PM

45
#281 - Sarang Khim / @sarang_khim

07/27/2022 at 07:08AM

45
#282 - D G G / @DGJourneyman

02/20/2023 at 09:07AM

45
#283 - Kaepa69 / @kaepa3

11/04/2023 at 03:43PM

46
#284 - Max Studanski / @MStudanski

10/06/2022 at 02:55PM

46
#285 - Dmitry Egorov / @egrvdd

11/09/2022 at 03:10PM

46
#286 - Михаил Зайцев / @mishazayts

09/07/2023 at 08:44AM

47
#287 - Joey Schoblaska / @joeyschoblaska

02/15/2023 at 05:15PM

47
#288 - Delusi Van Houtan / @VanDelusi

03/05/2023 at 09:22AM

48
#289 - AshleyF / @AshleyF

01/02/2024 at 08:15AM

49
#290 - Kaporos / @kaporos_

07/29/2022 at 01:41PM

49
#291 - MerryElvira / @ElviraBTC

09/19/2022 at 02:02PM

49
#292 - Abhijeet Bodas / @apbodas

10/31/2022 at 02:25PM

49
#293 - John Clara / @johnanthclara

04/19/2023 at 04:44AM

51
#294 - dhrubajyoti ghosh / @dhruba02

09/18/2022 at 05:22AM

51
#295 - vimgolfer / @vimgolf321

09/18/2022 at 05:26AM

51
#296 - reteach / @roblox_reteach

03/24/2023 at 03:38PM

53
#297 - Daniel Enrico Botta / @danenbo

07/27/2022 at 01:37PM

53
#298 - Eric Bonet / @ericcbonet

10/23/2022 at 09:19AM

53
#299 - Hugo Tai / @HugoTai100

02/09/2023 at 08:29AM

53
#300 - Varun Ramesh / @varun_rameshh

07/11/2023 at 05:40AM