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 174 remaining solutions by signing in and submitting your own entry
#175 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

175 active golfers, 436 entries

Leaderboard (lowest score wins):
23
#121 - Balkoth / @_Balkoth_

04/22/2011 at 06:09AM

23
#122 - Arthur Hinh / @arthur_hinh

04/23/2011 at 01:53AM

23
#123 - sorami / @boredoms

04/30/2011 at 11:26PM

23
#124 - Matthieu Honel / @ocus

05/06/2011 at 01:30PM

23
#125 - Sam / @dtjohnnymonkey

05/31/2011 at 09:52PM

23
#126 - Andrew Radev / @andrewradev

06/28/2011 at 07:45PM

23
#127 - Dan Masquelier / @danmasq

07/01/2011 at 09:47PM

23
#128 - akhilravidas / @akhilravidas

07/31/2011 at 01:53PM

23
#129 - Dario Cazzaro / @darioqa

09/17/2011 at 06:22PM

23
#130 - William Dunand / @wdunand

11/07/2011 at 03:23AM

23
#131 - Nick Klauer / @klauern

11/20/2011 at 04:24AM

23
#132 - Milan Dobrota / @milandobrota

11/21/2011 at 03:57AM

23
#133 - Michal Cichra / @_mikz

11/24/2011 at 12:26AM

23
#134 - Shannon / @shannonskipper

12/01/2011 at 10:34PM

23
#135 - Mislav Marohnić / @mislav

12/05/2011 at 10:38PM

23
#136 - Xavier Nayrac / @lkdjiin

01/02/2012 at 05:37PM

23
#137 - ɟpsq / @bsdf

02/08/2012 at 08:18PM

23
#138 - Jyun-Fan Tsai / @fakecolor

02/17/2012 at 02:17PM

23
#139 - Sergey Kim / @skim1776

03/25/2012 at 07:56AM

23
#140 - 蒼時弦也 / @elct9620

03/30/2012 at 01:36PM

23
#141 - Feanor Celebrimbor / @tumbaletaurea

06/04/2012 at 04:06AM

23
#142 - Nipunn Koorapati / @nipunn1313

07/21/2012 at 10:28PM

23
#143 - Marcin Szamotulski / @me_coot

09/25/2012 at 09:34AM

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

07/28/2013 at 08:30PM

23
#145 - LLiseil / @lliseil

07/17/2014 at 06:12PM

23
#146 - Jakob / @jajob

11/02/2014 at 08:10PM

23
#147 - Jake Eaton / @Jake__Eaton

02/28/2015 at 07:32AM

23
#148 - ltn614 / @ltn614

09/29/2015 at 08:16PM

24
#149 - Zak Johnson / @zakj

04/22/2011 at 02:57AM

24
#150 - Vojtěch Šívr / @VojtechSivr

06/09/2011 at 11:15PM