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

589 active golfers, 2544 entries

Leaderboard (lowest score wins):
50
#481 - a(knzw) / @aknzw1

04/12/2022 at 08:20AM

50
#482 - El Achèche ANIS 🇹🇳 / @elacheche

04/25/2022 at 05:36AM

50
#483 - Jerry Liu / @JoelJoshanX

06/02/2022 at 01:55AM

50
#484 - Andy Tso / @AndyTso7

07/11/2022 at 12:06AM

50
#485 - Brandon Banks / @brandonmbanks

11/19/2022 at 03:08AM

50
#486 - Djairo / @djairoh

12/04/2023 at 06:38PM

51
#487 - Gunter Kluge / @KlugeGunter

04/05/2022 at 03:07PM

51
#488 - meleu.sh / @meleushell

05/06/2022 at 03:21PM

51
#489 - Eric Briand / @eric_briand

05/12/2022 at 07:16AM

51
#490 - dogmeat / @dogmeat11

05/24/2022 at 09:44AM

51
#491 - Sean Corr / @seanc01212

02/03/2024 at 10:07PM

51
#492 - Luca Carotenuto / @LucaCarote32207

03/06/2024 at 09:35PM

52
#493 - Sithe / @SitheTie

05/05/2022 at 10:09PM

52
#494 - sjosbbfkd / @sjosbbfkd

05/15/2022 at 06:09AM

52
#495 - Denis / @swmmci

06/28/2022 at 11:00PM

52
#496 - Joe Bushi / @joebushi

12/01/2022 at 12:32AM

52
#497 - Dyl-DawG / @ScribeDylDawG

02/27/2023 at 08:17PM

53
#498 - 강태화 / @kangtaehwa1234

03/18/2022 at 07:57AM

53
#499 - Ed / @Ed43907641

04/05/2022 at 04:34PM

53
#500 - Kyle Channer / @KyleC_Designs

05/27/2022 at 10:14PM

53
#501 - Zachary Peterson / @zpeterson16

07/27/2022 at 11:50AM

53
#502 - user113333 / @user113333

05/13/2024 at 01:31PM

54
#503 - William / @williamwjh

04/11/2022 at 05:37PM

54
#504 - Alvaro Neto / @AlvaroN15101725

05/05/2022 at 05:08AM

54
#505 - sakura / @sakura79856991

06/01/2022 at 11:06AM

54
#506 - Nicolas Kreutzer / @NigiCereal

06/13/2022 at 07:18AM

55
#507 - Nakula Neeraje / @nakula_neeraje

04/08/2022 at 08:50PM

55
#508 - Meshan Naidoo / @realmeshan

10/24/2022 at 07:57AM

55
#509 - Thomas 🏴 / @ThomasGrgrczk

11/19/2022 at 11:44AM

56
#510 - Carlos Gracia / @Elrauk

04/08/2022 at 10:03AM