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 9v006233d72d000000000219

Fix the shell script!

Fix the shell script with the fewest keystrokes!

Start file
#!/bin/bash
a = 5
b = 10
sum = $a + $b
echo $sum

mul = $a * $b
echo $mul
End file
#!/bin/bash
a=5
b=10
sum=$((a + b))
echo $sum

mul=$((a * b))
echo $mul

View Diff

2,4c2,4
< a = 5
< b = 10
< sum = $a + $b
---
> a=5
> b=10
> sum=$((a + b))
7c7
< mul = $a * $b
---
> mul=$((a * b))

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 449 remaining solutions by signing in and submitting your own entry
#450 陈石峰 / @lazycode1226 - Score: 246 - 10/10/22 @ 06:45
jjkkjjkkjo<Esc>dujkkjuujjkjjjjk:s<BS>ss<BS><BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>%s/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>=<BS> = =<BS>/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>=/g<CR>:4,7s<BS>s<BS>s<BS>s/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>$a/s<BS>s<BS>((<BS><BS>\<BS>((/g<BS><BS>a/g<CR>:<Up><Left><Left><Left><Left><Left><Left><BS>b<Right><Right><Right><Right><Right><Right><Left><Left><Left><BS><BS><Right><BS>b))<CR>:.<BS>s<BS>s<BS><Up><Left><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>s<BS>s<BS>s/((<BS>/<BS>/<BS><BS>/<BS>(<Left>\<Right>/<BS><BS><BS>(/<BS>(/$((/g<CR>qq<Esc><0xef><0xbc><0x9a><0xef><0xbc><0x9a><Esc>sk<Esc>ukjZZ

0 comments


Created by: @u_hossein

450 active golfers, 1852 entries

Leaderboard (lowest score wins):
76
#421 - Luca Carotenuto / @LucaCarote32207

07/08/2023 at 12:54PM

78
#422 - Daneil yan / @ex4722

03/30/2022 at 09:59PM

79
#423 - 高卫东 / @Crazy_________K

09/30/2022 at 06:37AM

83
#424 - asayake / @995himada

04/09/2022 at 01:27PM

84
#425 - Daniel Mota / @danielmotaa11

06/01/2022 at 04:21AM

87
#426 - Michael Carolin / @mpcarolin

05/07/2022 at 03:01PM

89
#427 - Ryan Murphy / @RyanMur03026891

04/26/2022 at 12:43PM

89
#428 - Benjamin / @benjamin_le_

05/19/2022 at 04:01AM

89
#429 - 김태완 / @kr_srpn

01/17/2023 at 04:23AM

90
#430 - Jerred Shepherd / @ShepherdJerred

05/04/2022 at 10:19PM

91
#431 - asdf / @asdf75821425

05/21/2022 at 04:37PM

94
#432 - Dončić Stan / @blackmesssi

04/06/2022 at 05:13PM

94
#433 - Hart Traveller / @HartTraveller

05/11/2022 at 07:30AM

96
#434 - yurei / @yurei38667012

12/16/2022 at 07:44AM

97
#435 - TOM / @TOM19348482

05/22/2022 at 09:32AM

99
#436 - Mikołaj / @miko_aj4846

09/03/2023 at 03:14PM

100
#437 - jack2023xxx / @jack2023xxx

08/28/2023 at 03:15PM

121
#438 - Jiri Coviet / @JCoviet

04/07/2022 at 03:18PM

127
#439 - Jez dufourq / @Jezdufourq

06/19/2022 at 11:24AM

130
#440 - 전정민 / @ppuep2

03/18/2022 at 12:29PM

133
#441 - 苏庆祝 / @sqngzh21

01/17/2023 at 12:53AM

136
#442 - Mat / @mateuscolvr

04/03/2022 at 05:04AM

139
#443 - Edward Chen / @chen_eddi

06/08/2023 at 02:50PM

151
#444 - Briel Santana / @briel_santana

06/02/2022 at 11:53AM

153
#445 - 💻:~/Karl_Webster / @KTW727

09/08/2022 at 07:39AM

175
#446 - unchi / @unchi10723002

05/06/2022 at 12:08PM

187
#447 - Plamen Andreev / @plam4u

03/20/2022 at 11:28AM

200
#448 - Miguel Alcaraz / @dr_miguelar

01/23/2023 at 10:11PM

214
#449 - 徐坤 蔡 / @xukunca10413866

05/21/2022 at 03:54AM

246
#450 - 陈石峰 / @lazycode1226

10/10/2022 at 06:45AM