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):
56
#511 - Karl Marx / @Xura_Kurtanidze

04/26/2022 at 11:17AM

57
#512 - Хью Джолли / @DzolliH

06/20/2022 at 06:09AM

57
#513 - yash / @ygaitonde

11/25/2022 at 05:16PM

57
#514 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 09:37PM

57
#515 - QKSDM / @qksdm

01/26/2024 at 04:25PM

57
#516 - Kanmuruuruu / @Kanmuruuruu

04/04/2024 at 07:03PM

57
#517 - Elliot Schemmel / @regulated

10/07/2024 at 06:22PM

58
#518 - Richard / @ohheyrj_

07/13/2022 at 10:52PM

58
#519 - Himanshu Tank / @himanshutank75

10/16/2022 at 02:25PM

58
#520 - owner / @owner87643936

04/24/2023 at 12:36PM

60
#521 - Pin / @pinefule

04/05/2022 at 04:55AM

61
#522 - ylv / @ylv_io

04/01/2022 at 09:54PM

61
#523 - Pham Tuan Anh / @anhpt379

07/10/2022 at 10:52AM

61
#524 - hyunw0n / @hyunw0n

04/13/2024 at 07:15AM

62
#525 - Alan Rezende 🔥 Full Stack Developer / @alanrezende

04/30/2022 at 08:02PM

62
#526 - Alex Liu / @liualexliualex

05/21/2022 at 07:09AM

62
#527 - djheidihoe / @djheidihoe1

07/18/2022 at 10:01PM

62
#528 - e.cousinet / @ecousinet

07/16/2024 at 07:20PM

63
#529 - gohuorse / @go_hourse

05/21/2022 at 02:32PM

63
#530 - Thomas Hiron / @thomashiron

02/20/2023 at 10:45AM

64
#531 - Alexander Ruiztagle / @aruiz_tagle

11/24/2022 at 10:48AM

64
#532 - Willy / @Willy6932612311

08/30/2024 at 06:56AM

65
#533 - Raimondas Kazlauskas / @RhymondK

03/28/2022 at 02:17PM

65
#534 - Cyrus Kirk / @cyrusjkirk

02/02/2023 at 03:17PM

65
#535 - Leander / @LiLangning

04/06/2024 at 02:30PM

65
#536 - Bùi Lê Huỳnh / @wyattbui

06/07/2024 at 05:03PM

66
#537 - Gregory Bleiker / @gregory_bleiker

03/23/2022 at 01:52PM

66
#538 - Milan Gunasekera / @GunasekeraMilan

03/30/2022 at 08:41AM

66
#539 - Ty Harlacker / @tizzleh

10/22/2022 at 12:35AM

67
#540 - Abhijeet Bodas / @apbodas

10/30/2022 at 04:58PM