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 4db0b1c8e8eb0f564b00001c

Case preserving word replacement

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

Start file
function Human() {

}

Human.prototype = {
        humanStuff
: function(){},
        doHumanStuff
: function() {
                useDigitalWatch
();
       
}
}
End file
function Dog() {

}

Dog.prototype = {
        dogStuff
: function(){},
        doDogStuff
: function() {
                useDigitalWatch
();
       
}
}

View Diff

1c1
< function Human() {
---
> function Dog() {
5,7c5,7
< Human.prototype = {
<       humanStuff: function(){},
<       doHumanStuff: function() {
---
> Dog.prototype = {
>       dogStuff: function(){},
>       doDogStuff: function() {
10a11
>

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 179 remaining solutions by signing in and submitting your own entry
#180 Jacob Rosenblatt / @JKRosenblatt - Score: 71 - 06/15/14 @ 16:02
:%s/[Hu<BS>human<Left><Left><Left><Left>]<Right><Right><Right><Right>/\=submatch(0) ==# 'human' ? 'dog' : 'Dog'/g<CR>:wq<CR>

0 comments


Created by: @captain_morgan

180 active golfers, 454 entries

Leaderboard (lowest score wins):
21
#91 - Kent Sibilev / @datanoise

06/30/2011 at 05:25AM

21
#92 - Torben Rasmussen / @rasmustorben

08/15/2011 at 05:37PM

21
#93 - Dühöngő / @aswna

09/02/2011 at 06:38PM

21
#94 - Jon Allured / @jonallured

09/14/2011 at 01:35AM

21
#95 - Christopher Erin / @MCNormalMode

09/21/2011 at 08:39PM

21
#96 - Andy Pincombe / @ampersandy

10/29/2011 at 10:29AM

21
#97 - Dave Harrington / @ozzy_dave

11/06/2011 at 12:18AM

21
#98 - 415fox / @415fox

11/08/2011 at 06:36PM

21
#99 - Arton0306 / @Arton0306

12/18/2011 at 05:05PM

21
#100 - Rik Lomas / @riklomas

12/30/2011 at 12:27AM

21
#101 - Kurt Gaastra / @KGaastra

02/13/2012 at 02:37AM

21
#102 - Alexander Scherbinin / @realmyst

02/14/2012 at 12:37AM

21
#103 - じょんあば / @john_ababa

02/27/2012 at 12:31PM

21
#104 - Golf Sinteppadon / @minigolf2000

04/27/2012 at 10:49PM

21
#105 - Nolen Royalty / @NolenRoyalty

05/15/2012 at 07:23PM

21
#106 - Fernando Ortiz / @fortiz2k

06/17/2012 at 07:29AM

21
#107 - Javier Cervantes / @solojavier

08/31/2012 at 09:10PM

21
#108 - James / @Dronak

09/05/2013 at 02:43PM

21
#109 - Joonas Pihlajamaa / @jokkebk

02/21/2014 at 08:29AM

21
#110 - Carlos Hernando / @chernando

04/26/2014 at 06:56PM

21
#111 - Connie Qi / @connieqi

06/11/2014 at 04:43PM

21
#112 - Tom / @BureaucratGr11

06/30/2015 at 07:52PM

21
#113 - Daniel / @Daniel00288663

04/05/2017 at 09:45AM

21
#114 - POSIX / @po6ix

01/30/2022 at 07:19AM

21
#115 - steve / @steve35773420

03/04/2023 at 03:58PM

22
#116 - Thom Hughes / @thom_hughes_1

05/04/2011 at 05:34AM

22
#117 - t__naka / @t__naka

08/12/2011 at 07:42AM

22
#118 - こばばー / @symmet

09/07/2011 at 08:04AM

22
#119 - Matt Woelk / @MattWoelk

11/12/2011 at 12:21AM

22
#120 - strager / @strager

12/12/2011 at 02:45AM