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):
27
#121 - Funky McBeef / @FunkyMcBeef

09/12/2022 at 02:37PM

27
#122 - Kevin Chen / @kevkevchen

09/18/2022 at 06:39AM

27
#123 - キムラ・OPEL・ユウジ / @kimurayuuji79

09/21/2022 at 03:36AM

27
#124 - Chris AtLee / @chrisatlee

09/25/2022 at 09:15PM

27
#125 - Nikolaj Sidorenco / @nikolajdws

09/29/2022 at 12:58PM

27
#126 - Opposite Invictus / @OppositeInvict2

10/07/2022 at 07:52PM

27
#127 - Nancho Alvarez / @nancho_alvarez

10/25/2022 at 12:09AM

27
#128 - Andrii Romashchenko / @aromarom64

10/25/2022 at 06:18PM

27
#129 - jimmarq / @jimmarq

10/28/2022 at 08:57PM

27
#130 - Mantas Pilipuitis / @MPilipuitis

11/01/2022 at 11:16AM

27
#131 - Gs Abl / @gs_abl

11/27/2022 at 09:30AM

27
#132 - Lars Winderling / @kaHaleMaKai

11/29/2022 at 07:27PM

27
#133 - MC / @MC88686523

12/01/2022 at 05:04PM

27
#134 - Dany L'Hébreux / @dlhebreux

12/02/2022 at 03:00AM

27
#135 - ✨ / @startresse

12/07/2022 at 10:10AM

27
#136 - Stuart Spinner / @StuartSpinner

12/19/2022 at 12:41AM

27
#137 - Marco Meinardi / @Kee__no

12/29/2022 at 06:42PM

27
#138 - Bruce Woodward / @b00ffer

01/03/2023 at 02:10AM

27
#139 - Arne / @arnkaes

01/16/2023 at 09:30PM

27
#140 - e_e / @eleloi

02/10/2023 at 07:35PM

27
#141 - Ahmed Mashalla / @Hahgaayyyy

02/28/2023 at 07:49PM

27
#142 - @AndrewRadev@hachyderm.io / @andrewradev

03/04/2023 at 01:31PM

27
#143 - RosaTryp / @RosaTryp

03/10/2023 at 02:46PM

27
#144 - François / @mortyZZ

03/23/2023 at 10:48PM

27
#145 - Alexander Curtis / @AlexOnCode

03/24/2023 at 06:45PM

27
#146 - Aliasf / @rammenmaster96

04/02/2023 at 01:32PM

27
#147 - James Reading / @bowly_jim

04/14/2023 at 01:11PM

27
#148 - Olivier Bégassat / @zk_evm

06/11/2023 at 11:38AM

27
#149 - Bill Ruddock / @biinari

08/03/2023 at 12:39AM

27
#150 - Daniel Apt / @DanielApt

08/26/2023 at 08:56AM