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):
26
#31 - Danilo J. S. Bellini πŸ₯ŠπŸ‡§πŸ‡· / @danilobellini

07/24/2022 at 10:49PM

26
#32 - 'ymdarake / @ymdarake

08/22/2022 at 01:39PM

26
#33 - Janzen / @__Coos

09/13/2022 at 06:42AM

26
#34 - Leroy Jenkins / @LeroyJe70429357

09/15/2022 at 10:24PM

26
#35 - Alex Lewin / @_AlexLewin

09/19/2022 at 05:47PM

26
#36 - Jay R / @RonatinJ

09/25/2022 at 09:08PM

26
#37 - Topvimgolf Score / @topvimgolfscore

10/15/2022 at 10:10AM

26
#38 - Avicenna / @avicenna1231

10/16/2022 at 08:23PM

26
#39 - Andrii Soldatenko / @a_soldatenko

10/17/2022 at 05:23PM

26
#40 - Henrique Malheiro / @rike09

10/27/2022 at 11:39PM

26
#41 - Iron Manders / @MandersIron

10/30/2022 at 08:48PM

26
#42 - David W. / @BigWangTheory1

12/03/2022 at 07:11PM

26
#43 - Alexander Morozov / @scanhex

12/07/2022 at 03:52PM

26
#44 - fraktal / @FraktalRebirth

01/29/2023 at 03:02AM

26
#45 - Torikatsu / @torikatsu923

03/28/2023 at 10:58AM

26
#46 - fengc / @fengc

06/14/2023 at 06:58AM

26
#47 - theorem / @theorem

08/10/2023 at 12:16AM

26
#48 - LandR / @ListenAndR

10/20/2023 at 01:32AM

26
#49 - Paul Molloy / @paulsmolloy

10/20/2023 at 03:12PM

26
#50 - Seok Hwan Kim / @gworldkim

10/29/2023 at 02:03PM

26
#51 - alexscott / @4l3xsc0tt

11/06/2023 at 10:58PM

26
#52 - 3.14 / @pi-ratio

04/11/2024 at 02:17PM

26
#53 - Aly Thobani / @alythobani

04/12/2024 at 05:54AM

26
#54 - MOONSpace1017 / @MOONSpace1017

04/13/2024 at 12:04PM

26
#55 - μœ μ±„μš΄ / @painkiller_2357

04/13/2024 at 02:22PM

26
#56 - Kimchanyuuu / @Kimchanyuuu

04/13/2024 at 08:23PM

26
#57 - κΉ”κΉ” / @dddh8204

04/14/2024 at 10:09AM

26
#58 - lnorbo / @lnorbo

06/07/2024 at 09:21AM

26
#59 - Peppa Pig / @PeppaPi95550250

07/14/2024 at 02:25AM

26
#60 - nickGPT / @nickandbro

08/27/2024 at 04:48AM