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

603 active golfers, 2596 entries

Leaderboard (lowest score wins):
27
#91 - satetheus-vimgolf / @SVimgolf

07/17/2022 at 04:40AM

27
#92 - Lory / @Lory46845742

07/23/2022 at 08:13AM

27
#93 - Rui Xue / @ruirayxue

08/30/2022 at 05:52AM

27
#94 - Eivind Jahren / @HaskellElephant

09/12/2022 at 07:34PM

27
#95 - sap / @sap38838304

09/27/2022 at 01:49AM

27
#96 - Paradoxskin / @paradoxskin

10/31/2022 at 11:50AM

27
#97 - andrewalker@mastodon.green / @andrewalkernet

11/08/2022 at 02:51PM

27
#98 - Mrmclarrinson / @mrmclarrinson

12/11/2022 at 11:12AM

27
#99 - 0xf00ff00f / @0xf00ff00f

12/13/2022 at 07:56PM

27
#100 - DW Luna / @dcheed_

12/21/2022 at 01:59PM

27
#101 - でよ / @tada_kun8

01/24/2023 at 03:22AM

27
#102 - 妹様万歳 / @imoutomansai

02/08/2023 at 04:40PM

27
#103 - Yunus Emre Yücel / @_yunusey_

02/21/2023 at 03:03AM

27
#104 - 蛙爹 / @Joe53572723

02/21/2023 at 07:04AM

27
#105 - Bruce Woodward / @b00ffer

03/26/2023 at 03:53AM

27
#106 - 비둘기 / @a7AUna3f37W54Fb

04/04/2023 at 12:29PM

27
#107 - Tanzeel Kazi / @tanzeelkazi

06/21/2023 at 02:52AM

27
#108 - 1 des frr fourmis / @frrfourmi

06/28/2023 at 01:05PM

27
#109 - Bertold E. / @bertold_e66506

07/01/2023 at 09:58AM

27
#110 - わーお / @lwgZVRoOQ8Nf6VG

07/04/2023 at 08:16AM

27
#111 - moh ayaya / @AyayaMoh

08/20/2023 at 02:52PM

27
#112 - naka / @nak38223985244

09/06/2023 at 01:06PM

27
#113 - Monkey Boy / @monkey29089

09/23/2023 at 05:46AM

27
#114 - Luoyb / @Luoyb

10/21/2023 at 05:33AM

27
#115 - bpking1 / @bpking1

11/22/2023 at 01:25AM

27
#116 - lethalNeutrino / @lethalNeutrino

11/28/2023 at 12:44PM

27
#117 - Remus Dalrymple / @bornintheflames

01/01/2024 at 09:05AM

27
#118 - jeffreymrussell / @jeffreymrussell

01/05/2024 at 12:21PM

27
#119 - 0spear / @0spear

04/10/2024 at 01:52PM

27
#120 - Lennart / @lennartack

04/28/2024 at 08:03PM