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 618 remaining solutions by signing in and submitting your own entry
#619 陈石峰 / @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

619 active golfers, 2663 entries

Leaderboard (lowest score wins):
40
#421 - LukasOates / @LukasOates

07/19/2024 at 11:56AM

40
#422 - Tyler Tivadar / @tylertiv

08/24/2024 at 06:25PM

40
#423 - Diwakar Singh Parmar / @parmardiwakar150

08/26/2024 at 06:28PM

40
#424 - kokame / @tohiraoka

08/31/2024 at 03:55PM

40
#425 - Geon Woo Lee / @mystlee

03/25/2025 at 05:30PM

41
#426 - mebuh / @mebuh42

03/22/2022 at 08:16PM

41
#427 - スティーン@ニーツ / @raxmur

04/21/2022 at 09:27AM

41
#428 - Eric Xue / @ericxues

05/15/2022 at 01:46AM

41
#429 - vin / @vin7654321

06/04/2022 at 09:42AM

41
#430 - xtncl / @xtncl

06/10/2022 at 08:43PM

41
#431 - Einn Seinn / @EinnSeinn

08/04/2022 at 02:25PM

41
#432 - Derek Salerno / @dsalernodev

12/01/2022 at 09:31PM

41
#433 - Toni Sedlmeier / @SedlmeierToni

01/10/2023 at 12:37PM

41
#434 - nerfed / @nerfed

06/03/2024 at 11:08PM

41
#435 - Aryan Kadole / @ak1932

08/17/2024 at 07:28PM

41
#436 - Frederik F / @FrederikFrederiksenMancofi

12/01/2025 at 09:15AM

42
#437 - Richy Strnad / @RichardStrnad

03/19/2022 at 08:09PM

42
#438 - Quatrix / @Quatrix

04/08/2022 at 10:29PM

42
#439 - 梅 / @umetosawara

04/09/2022 at 08:04AM

42
#440 - タケ / @Take3832

04/17/2022 at 01:18PM

42
#441 - Eric Guo / @Euclideant

06/19/2022 at 11:42AM

42
#442 - Nathan Iszlaub / @NIszlaub

10/21/2022 at 05:51PM

42
#443 - ⚫ hgtp://Shifor 🛠️ / @shifor_gnome

02/27/2023 at 03:29PM

42
#444 - Nikolay Miroshnychenko / @Nick_Mirosh

07/19/2023 at 07:37AM

42
#445 - raverbash / @raverbash

08/09/2023 at 11:18PM

42
#446 - dailybeef / @dailybeef

11/07/2023 at 03:29PM

42
#447 - potatol33t / @potatol33t

03/13/2024 at 02:41PM

42
#448 - John Kershaw / @johnkershaw

04/21/2024 at 05:43PM

42
#449 - Alastair Macfarlane / @macfarlane-dev

05/12/2024 at 12:56PM

42
#450 - Pablo Acuna / @pacuna

08/30/2024 at 12:51AM