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

184 active golfers, 815 entries

Leaderboard (lowest score wins):
24
#31 - ᴄʜᴜǫᴜᴇʙᴇᴄᴏɪs / @deco__45

02/04/2023 at 10:26PM

25
#32 - Jean George / @JeanGeo20504212

07/16/2022 at 10:39AM

25
#33 - loupiot.veloce / @LoupiotVeloce

07/17/2022 at 03:23PM

25
#34 - wpr__ / @wpr____

07/19/2022 at 02:40PM

25
#35 - Lory / @Lory46845742

07/22/2022 at 03:07PM

25
#36 - GreenPinguin / @GreenPinguin2

07/26/2022 at 11:58AM

25
#37 - Eric Briand / @eric_briand

07/29/2022 at 01:58PM

25
#38 - Léo / @Leo58369183

08/22/2022 at 07:07AM

25
#39 - brett / @brettyukich

08/26/2022 at 03:57PM

25
#40 - 비비빅 / @bibibig80714274

09/05/2022 at 03:54PM

25
#41 - Jonny / @Jonnytron

09/15/2022 at 02:52PM

25
#42 - Julien Durillon / @juuduu

09/29/2022 at 05:03PM

25
#43 - Vlad Yaglamunov / @VladYaglamunov

10/12/2022 at 01:58PM

25
#44 - WladDalwM / @WladDalwM

10/13/2022 at 03:35PM

25
#45 - JongHwan Kim / @shockrabbit17

10/21/2022 at 12:30AM

25
#46 - Nathan Iszlaub / @NIszlaub

10/21/2022 at 03:53PM

25
#47 - おせよ / @OhSayYo

11/13/2022 at 09:09AM

25
#48 - Kha Nguyen / @__ngtrongkha

11/27/2022 at 04:06PM

25
#49 - Dank City / @ddankcity

12/01/2022 at 09:45PM

25
#50 - jajima / @jajima_jp

12/04/2022 at 10:47AM

25
#51 - Ivan Trepakov / @liontiger23

12/30/2022 at 03:20PM

25
#52 - макар бананович / @babnanbab

02/04/2023 at 10:21PM

27
#53 - Smylers / @Smylers2

07/15/2022 at 01:21PM

27
#54 - satetheus-vimgolf / @SVimgolf

07/17/2022 at 05:17AM

27
#55 - TimMcGuire / @mcguire

07/18/2022 at 10:52PM

27
#56 - cqjxx / @cqjxx1

07/20/2022 at 02:01PM

27
#57 - Aleksandre Khokhiashvili / @skkhokho

07/23/2022 at 10:28AM

27
#58 - Zachary Peterson / @zpeterson16

07/27/2022 at 11:40AM

27
#59 - mika / @mika31120321

07/30/2022 at 11:29AM

27
#60 - Maksim Galinchik / @MGalinchik

08/02/2022 at 11:00PM