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):
36
#361 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

03/19/2024 at 09:49AM

36
#362 - Casper Wong / @CasperWong-jpg

04/05/2024 at 03:27AM

36
#363 - constap / @constap

04/19/2024 at 03:24PM

36
#364 - Martin Harvan / @martinhrvn

06/06/2024 at 08:40PM

37
#365 - Clmi / @c_decaf

04/08/2022 at 07:28AM

37
#366 - ccorvi / @ccorvi1

05/16/2022 at 03:29PM

37
#367 - kovapi3088@serosin.com / @test39654481

06/22/2022 at 03:13PM

37
#368 - adrian / @adrian09610908

08/08/2022 at 04:25AM

37
#369 - Moritz Kraus / @MoritzKraus4

09/03/2022 at 06:13PM

37
#370 - Vim Golf / @Golf4Vim

10/30/2022 at 07:24PM

37
#371 - mveraart / @mveraart

11/17/2023 at 07:56PM

37
#372 - Kevin Lou / @klou23

07/26/2024 at 05:00PM

37
#373 - HYoMo-nim / @HYoMo-nim

03/28/2025 at 04:35PM

37
#374 - rlatmdgk1203 / @rlatmdgk1203

03/31/2025 at 11:13AM

37
#375 - kimbadaa / @kimbadaa

04/02/2025 at 02:47PM

38
#376 - Nougatine Naja / @NougatineNaja

03/22/2022 at 12:15PM

38
#377 - Jason Kuan | jasonkuan.eth / @Jason9075Kuan

04/03/2022 at 10:04AM

38
#378 - Eric Wannemacher / @ericwannemacher

04/03/2022 at 10:57PM

38
#379 - Alex / @AlexanderHeatl2

05/21/2022 at 08:47PM

38
#380 - happy cola / @ccolahappy

06/11/2022 at 07:16PM

38
#381 - ohwell / @KiranClose

07/30/2022 at 03:44PM

38
#382 - Alfio / @Alfio31105646

05/14/2023 at 01:07PM

38
#383 - Erick Gonzalez / @eygl_erick

06/09/2023 at 03:41AM

38
#384 - Peter Szerzo / @peterszerzo

07/08/2023 at 07:58AM

38
#385 - Marius Ropotica / @cipmar

03/30/2024 at 05:40AM

38
#386 - Marc-Andre Lureau / @elmarco

07/25/2024 at 03:18PM

38
#387 - Xiaoshubudao / @XiaoshuZ73684

08/19/2024 at 11:07PM

38
#388 - dp403aan / @dp403aan

02/07/2025 at 06:27PM

39
#389 - Emil / @emilklindt

04/04/2022 at 04:03PM

39
#390 - Justin Sane / @Here4Vimgolf

04/22/2022 at 02:13PM