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

333 active golfers, 1506 entries

Leaderboard (lowest score wins):
27
#151 - Olivier Bégassat / @zk_evm

06/11/2023 at 11:38AM

27
#152 - Bill Ruddock / @biinari

08/03/2023 at 12:39AM

27
#153 - Daniel Apt / @DanielApt

08/26/2023 at 08:56AM

27
#154 - Matthew Finlayson / @mattf1n

08/29/2023 at 06:09PM

27
#155 - 李建宏 / @xx19971016

08/30/2023 at 08:40AM

27
#156 - Aaron Hunt / @ach5910

09/27/2023 at 08:16PM

27
#157 - Josh Harrison / @ultrapasty

10/26/2023 at 10:56AM

27
#158 - Ludovic Schwartz / @ludovicschwartz

11/24/2023 at 12:05PM

27
#159 - jonas-grobe / @jonas-grobe

02/02/2024 at 07:43PM

27
#160 - Anaritus / @Anaritus

02/23/2024 at 11:49AM

28
#161 - Johan Arrhen / @JoPeArrhen

09/24/2022 at 12:38PM

28
#162 - Laughing Cavalier / @jovial_cavalier

10/26/2022 at 03:32PM

28
#163 - Florian Leitner / @flowing

12/06/2022 at 03:58PM

28
#164 - 1 des frr fourmis / @frrfourmi

06/21/2023 at 03:46PM

28
#165 - Michael Floßmann / @MFlossmann

02/27/2024 at 02:38PM

28
#166 - tyanagstr / @tyanagstr

04/30/2024 at 04:34AM

29
#167 - Nougatine Naja / @NougatineNaja

07/26/2022 at 12:46PM

29
#168 - vuems / @vuems2win

11/11/2022 at 12:57AM

29
#169 - Kieron Browne / @KieronBrowne1

11/21/2022 at 08:58PM

29
#170 - Benjamin / @BenjaminBashar

12/16/2022 at 03:20AM

29
#171 - KyuYoung Heo / @bbvch13531

01/13/2023 at 04:21AM

29
#172 - 马海洋 / @LG41bT7ZvqOdFl3

02/07/2023 at 03:34AM

29
#173 - rstcruzo / @rstcruzo

03/05/2023 at 06:51AM

29
#174 - Selvaganapathy P / @canabady

04/10/2023 at 02:22PM

29
#175 - Egor Voronov / @do_syscall_64

05/25/2023 at 05:29PM

29
#176 - wemgulf / @wemgulfer

11/02/2023 at 12:27PM

29
#177 - Daniel Allen / @danielgallen

01/13/2024 at 04:35PM

29
#178 - bonettimrc / @bonettimrc

04/27/2024 at 10:37PM

30
#179 - Austin Willliams / @GuitarMusash616

09/20/2022 at 03:25PM

30
#180 - 우정민 / @jeongmin2021

10/01/2022 at 03:19PM