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):
19
#31 - R.T. Lechow / @rtlechow

11/23/2011 at 04:06PM

19
#32 - You-Siang Lin / @yslinnctu

11/29/2011 at 05:10AM

19
#33 - Tesnorth / @Tesnorth

01/31/2012 at 02:47PM

19
#34 - Abdel Said / @abdelsaid

02/01/2012 at 06:38PM

19
#35 - Burkhard Zimmermann / @BurkZimm

02/01/2012 at 11:57PM

19
#36 - Pei-Lun Lee / @ypcatw

02/05/2012 at 01:59AM

19
#37 - Dave Smylie / @davesmylie

02/06/2012 at 10:27PM

19
#38 - Renat Aksitov / @Korvin79

02/08/2012 at 03:04PM

19
#39 - Michał Wróbel / @sparrovv_

03/14/2012 at 04:55PM

19
#40 - Chris Penkett / @chrispenkett

04/03/2012 at 06:28PM

19
#41 - Rod Knowlton / @codelahoma

04/27/2012 at 12:58AM

19
#42 - ise0615 / @ise0615

05/03/2012 at 03:30PM

19
#43 - Sebastian Kusnier / @skusnier

05/09/2012 at 09:27PM

19
#44 - Urtica dioica / @udioica

05/27/2012 at 09:23AM

19
#45 - Kerson Hsiao / @KersonHsiao

07/13/2012 at 01:10PM

19
#46 - Tyler / @tylerbindon

04/06/2013 at 11:51PM

19
#47 - Trevor Powell / @DoomedBunnies

04/16/2013 at 06:37AM

19
#48 - Marco Hinz / @_mhinz_

05/21/2013 at 11:13PM

19
#49 - Petro Тrouq / @zulolosi

08/30/2013 at 07:12PM

19
#50 - Oliver Christ / @0liverChrist

10/08/2013 at 09:26PM

19
#51 - cj / @cj01101

01/30/2014 at 09:42PM

19
#52 - John Braxler / @braxler

05/14/2014 at 07:34PM

19
#53 - Rob Glew / @RealGlew

06/12/2014 at 02:21PM

19
#54 - Charlene Tshos / @charlymul

06/12/2014 at 02:51PM

19
#55 - Walker Boh / @walker_boh

12/07/2015 at 12:06PM

19
#56 - Gurukandhamoorthi / @Gurukandhamoor1

08/12/2017 at 03:43PM

19
#57 - Turkey Man / @lvturkeyman

11/28/2017 at 05:29PM

19
#58 - DHM / @DHM29978992

05/24/2018 at 01:22AM

19
#59 - Mihai / @mihaicristiant

03/24/2019 at 12:18PM

19
#60 - vimgolfer / @vimgolfer7

10/19/2019 at 10:52PM