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):
22
#121 - bmamax / @bmamax

01/17/2012 at 03:08PM

22
#122 - Steven Sloss / @StevenSloss

02/19/2012 at 06:28PM

22
#123 - Paul Patience / @talmodighet

02/23/2012 at 07:03AM

22
#124 - arno renevier / @dadadiblog

03/19/2012 at 07:26AM

22
#125 - Nick Harding / @nick_harding

08/28/2013 at 08:31PM

23
#126 - Balkoth / @_Balkoth_

04/22/2011 at 06:09AM

23
#127 - Arthur Hinh / @arthur_hinh

04/23/2011 at 01:53AM

23
#128 - sorami / @boredoms

04/30/2011 at 11:26PM

23
#129 - Matthieu Honel / @ocus

05/06/2011 at 01:30PM

23
#130 - Sam / @dtjohnnymonkey

05/31/2011 at 09:52PM

23
#131 - @AndrewRadev@hachyderm.io / @andrewradev

06/28/2011 at 07:45PM

23
#132 - Dan Masquelier / @danmasq

07/01/2011 at 09:47PM

23
#133 - akhilravidas / @akhilravidas

07/31/2011 at 01:53PM

23
#134 - Dario Cazzaro / @darioqa

09/17/2011 at 06:22PM

23
#135 - William Dunand / @wdunand

11/07/2011 at 03:23AM

23
#136 - Nick Klauer / @klauern

11/20/2011 at 04:24AM

23
#137 - Milan Dobrota / @milandobrota

11/21/2011 at 03:57AM

23
#138 - Michal Cichra / @_mikz

11/24/2011 at 12:26AM

23
#139 - Shannon / @shannonskipper

12/01/2011 at 10:34PM

23
#140 - Mislav Marohnić / @mislav

12/05/2011 at 10:38PM

23
#141 - Xavier Nayrac / @lkdjiin

01/02/2012 at 05:37PM

23
#142 - ɟpsq / @bsdf

02/08/2012 at 08:18PM

23
#143 - Jyun-Fan Tsai / @fakecolor

02/17/2012 at 02:17PM

23
#144 - Sergey Kim / @skim1776

03/25/2012 at 07:56AM

23
#145 - 蒼時弦也 / @elct9620

03/30/2012 at 01:36PM

23
#146 - Feanor Celebrimbor / @tumbaletaurea

06/04/2012 at 04:06AM

23
#147 - Nipunn Koorapati / @nipunn1313

07/21/2012 at 10:28PM

23
#148 - Marcin Szamotulski / @me_coot

09/25/2012 at 09:34AM

23
#149 - Dr Rev J. “I am not a bot!” Kirchartz, KSC, KHS / @JKirchartz

07/28/2013 at 08:30PM

23
#150 - LLiseil / @lliseil

07/17/2014 at 06:12PM