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):
24
#151 - jacobcr / @jacobcr

08/24/2011 at 07:05AM

24
#152 - Daniel / @dbb0

02/20/2012 at 08:32PM

24
#153 - William Ott / @oddalot

04/12/2015 at 05:27PM

25
#154 - draft_val=3 / @draftcode

04/24/2011 at 08:00AM

25
#155 - Jacob Taylor / @jacobltaylor

08/24/2011 at 05:28PM

25
#156 - Jakub Arnold / @darthdeus

12/19/2011 at 03:52PM

25
#157 - Ibrahim Tencer / @ibrahimtencer

02/14/2012 at 12:09AM

25
#158 - Christian Helbling / @friendly_coder

04/09/2012 at 01:31PM

26
#159 - Radek / @qrczeno

05/08/2012 at 12:51PM

26
#160 - shahanavaz m / @shahanavazm

02/20/2022 at 10:47PM

27
#161 - Esteban Ordano / @eordano

04/28/2011 at 06:10AM

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

05/30/2011 at 04:16AM

27
#163 - Arto Vuori / @dhpe

08/31/2012 at 08:11PM

27
#164 - RockerZZY / @rocker_zzy

07/05/2020 at 03:02AM

28
#165 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 02:02AM

28
#166 - Alishah Chator / @alicharizard

06/11/2014 at 05:01PM

29
#167 - Brendan Taylor / @beect

04/26/2011 at 09:00PM

30
#168 - Seth Miller / @skigil

09/28/2011 at 07:27PM

33
#169 - Chris G / @AboutThatThing

06/12/2019 at 08:35AM

35
#170 - Toto l'haricot / @nico_le_terribl

06/19/2011 at 03:54AM

37
#171 - Andrew Michaud / @andrewjmichaud

09/04/2015 at 08:59PM

39
#172 - editor3D / @editor3D

11/13/2018 at 08:14PM

46
#173 - kuri65536 / @kuri65536

04/23/2011 at 04:14AM

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

04/22/2011 at 04:21PM

71
#175 - Jacob Rosenblatt / @JKRosenblatt

06/15/2014 at 04:02PM