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

160 active golfers, 383 entries

Leaderboard (lowest score wins):
19
#1 - Tim Chase / @gumnos

04/21/2011 at 11:13PM

19
#2 - Beau Dacious / @nocash

04/21/2011 at 11:46PM

19
#3 - Pete Johns / @johnsyweb

04/22/2011 at 05:42AM

19
#4 - Mathias Bynens  / @mathias

04/22/2011 at 06:51AM

19
#5 - Oleg Roshupkin / @jjjahson

04/22/2011 at 09:42AM

19
#6 - Pavlo Klets / @p01nt

04/22/2011 at 09:59AM

19
#7 - xhtmlforum / @xhtmlforum

04/22/2011 at 05:21PM

19
#8 - Wei Dai / @clvv42

04/23/2011 at 01:16AM

19
#9 - Stephen Morrow / @yawmark

04/23/2011 at 01:39PM

19
#10 - Malaney / @iamjh

04/26/2011 at 04:08AM

19
#11 - Chad Ostrowski / @chadoh

05/09/2011 at 03:52PM

19
#12 - Sam Wen / @sam_wen

05/13/2011 at 03:07AM

19
#13 - Dragan Cvetinovic / @kawkafi

05/19/2011 at 05:21PM

19
#14 - icdark / @icdark

05/30/2011 at 12:01AM

19
#15 - not so punk :] / @notsopunk

06/19/2011 at 08:57AM

19
#16 - Peter Anselmo / @peter_anselmo

06/23/2011 at 07:19PM

19
#17 - Johan Sveholm / @rymdtjuren

06/24/2011 at 08:59AM

19
#18 - (Emile (Swarts)) / @EmileSwarts

06/25/2011 at 11:48AM

19
#19 - Atan59 / @atan59vg

07/15/2011 at 12:08PM

19
#20 - Sammasati / @sammasati0

07/16/2011 at 03:14AM

19
#21 - Dave / @zzdave13

07/16/2011 at 03:53PM

19
#22 - Stephen Gordon / @DubsGordon

08/01/2011 at 11:48PM

19
#23 - Joshua Moyers / @joshuamoyers

08/03/2011 at 03:32AM

19
#24 - Hu Junfeng / @junfeng

08/04/2011 at 01:41PM

19
#25 - Federico Galassi / @federicogalassi

08/27/2011 at 10:29PM

19
#26 - Simon's Calf / @simonscarfe

09/06/2011 at 11:28AM

19
#27 - Justin Love / @wondible

09/13/2011 at 12:42PM

19
#28 - p0ckets / @p0ckets

10/07/2011 at 08:44AM

19
#29 - vimja / @vimja666

10/11/2011 at 07:17AM

19
#30 - Travis Jeffery / @travisjeffery

11/23/2011 at 07:49AM