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

165 active golfers, 394 entries

Leaderboard (lowest score wins):
26
#151 - Radek / @qrczeno

05/08/2012 at 12:51PM

27
#152 - Esteban Ordano / @eordano

04/28/2011 at 06:10AM

27
#153 - Teflon Ted t(◕‿◕t) / @teflonted

05/30/2011 at 04:16AM

27
#154 - Arto Vuori / @dhpe

08/31/2012 at 08:11PM

28
#155 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 02:02AM

28
#156 - Alishah Chator / @alicharizard

06/11/2014 at 05:01PM

29
#157 - Brendan Taylor / @beect

04/26/2011 at 09:00PM

30
#158 - Seth Miller / @skigil

09/28/2011 at 07:27PM

33
#159 - Chris G / @AboutThatThing

06/12/2019 at 08:35AM

35
#160 - Toto l'haricot / @nico_le_terribl

06/19/2011 at 03:54AM

37
#161 - Andrew Michaud / @andrewjmichaud

09/04/2015 at 08:59PM

39
#162 - editor3D / @editor3D

11/13/2018 at 08:14PM

46
#163 - kuri65536 / @kuri65536

04/23/2011 at 04:14AM

52
#164 - はたけやまたかし / @htkymtks

04/22/2011 at 04:21PM

71
#165 - Jacob Rosenblatt / @JKRosenblatt

06/15/2014 at 04:02PM