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 by @brian_leung:

Unlock 6 remaining solutions by signing in and submitting your own entry
Created by: @u_hossein

589 active golfers, 2544 entries

Solutions by @brian_leung:
27
#62 - Brian Leung / @brian_leung

03/26/2022 at 04:02AM

28
#>125 - Brian Leung / @brian_leung

03/26/2022 at 03:28AM

31
#>246 - Brian Leung / @brian_leung

03/26/2022 at 03:27AM

33
#>282 - Brian Leung / @brian_leung

03/26/2022 at 03:26AM

34
#>294 - Brian Leung / @brian_leung

03/26/2022 at 03:24AM

35
#>312 - Brian Leung / @brian_leung

03/26/2022 at 03:21AM