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 5052dd5c2a8bfe000200001c

Enharmonic Equivalents

Transform # and b to digraphs

Start file
Enharmonic Equivalents
C
# = Db
D
# = Eb
F
# = Gb
G
# = Ab
A
# = Bb
End file
Enharmonic Equivalents
C
= D
D
= E
F
= G
G
= A
A
= B

View Diff

diff --git a/input.txt b/output.txt
index 6e3429b..52b2969 100644
--- a/input.txt
+++ b/output.txt
@@ -1,6 +1,6 @@
Enharmonic Equivalents
C#C♯ = Db
D#D♭
D♯ = Eb
F#E♭
F♯ = Gb
G#G♭
G♯ = Ab
A#A♭
A♯ = BbB♭

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 36 remaining solutions by signing in and submitting your own entry
#37 shahanavaz m / @shahanavazm - Score: 47 - 04/01/24 @ 20:52
:%s/\C[#b]/\=tr(submatch(0),"#b","<C-K>MX<C-K>Mb")/g<CR>ZZ

0 comments


Created by: @DiffJunk

37 active golfers, 59 entries

Leaderboard (lowest score wins):
20
#31 - Gerald Tilma / @GeraldTilma

11/01/2015 at 02:13PM

22
#32 - Caek / @Caek_

07/29/2014 at 02:08AM

23
#33 - Raphaël De Giusti / @raphdg

09/14/2012 at 08:25AM

25
#34 - POSIX / @po6ix

02/02/2022 at 02:08PM

25
#35 - russellzhaomao / @russellzhaomao

06/05/2022 at 08:24AM

25
#36 - nickGPT / @nickandbro

08/28/2024 at 07:49PM

47
#37 - shahanavaz m / @shahanavazm

04/01/2024 at 08:52PM