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 127 remaining solutions by signing in and submitting your own entry
#128 θ’Όζ™‚εΌ¦δΉŸ / elct9620 - Score: 23 - 03/30/12 @ 13:36
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#129 Feanor Celebrimbor / tumbaletaurea - Score: 23 - 06/04/12 @ 04:06
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#130 Nipunn Koorapati / nipunn1313 - Score: 23 - 07/21/12 @ 22:28
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#131 Marcin Sza / coot_ - Score: 23 - 09/25/12 @ 09:34
wye:%s/<C-R>0/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#132 Dr Rev J. '𝕡. π•Άπ–Žπ–—π–ˆπ–π–†π–—π–™π–Ÿ' Kirchartz / JKirchartz - Score: 23 - 07/28/13 @ 20:30
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#133 LLiseil / lliseil - Score: 23 - 07/17/14 @ 18:12
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#134 Jakob / jajob - Score: 23 - 11/02/14 @ 20:10
:%s/human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#135 Jake Eaton / Jake__Eaton - Score: 23 - 02/28/15 @ 07:32
:%s;human;Dog;i<CR>k~Go<C-O>ZZ

0 comments


#136 ltn614 / ltn614 - Score: 23 - 09/29/15 @ 20:16
:%s/Human/Dog/i<CR>k~Go<Esc>ZZ

0 comments


#137 Zak Johnson / zakj - Score: 24 - 04/22/11 @ 02:57
:%s/[hH]uman/Dog<CR>k~Go<Esc>ZZ

0 comments


#138 VojtΔ›ch Ε Γ­vr / VojtechSivr - Score: 24 - 06/09/11 @ 23:15
:%s/human/Dog/i<NL>krd<C-End>o<Esc>ZZ

0 comments


#139 jacobcr / jacobcr - Score: 24 - 08/24/11 @ 07:05
:%s/human/Dog/i<CR>kvuGo<Esc>ZZ

0 comments


#140 Daniel / dbb0 - Score: 24 - 02/20/12 @ 20:32
:%s/human/Dog/i<CR>krdGo<Esc>ZZ

0 comments


#141 William Ott / oddalot - Score: 24 - 04/12/15 @ 17:27
:%s/human/Dog/i<CR>krdGo<Esc>ZZ

0 comments


#142 draft_val=3 / draftcode - Score: 25 - 04/24/11 @ 08:00
:%s/Human/Dog/i<CR>k~Go<Esc>:wq<CR>

0 comments


#143 Jacob Taylor / jacobltaylor - Score: 25 - 08/24/11 @ 17:28
:%s/Human/Dog/gi<CR>krdGo<Esc>ZZ

0 comments


#144 Jakub Arnold / darthdeus - Score: 25 - 12/19/11 @ 15:52
:%s/human/Dog/i<CR>k~Go<Esc>zzZZ

0 comments


#145 Ibrahim Tencer / ibrahimtencer - Score: 25 - 02/14/12 @ 00:09
:%s/human\c/Dog/g<CR>k~Go<Esc>ZZ

0 comments


#146 Christian Helbling / friendly_coder - Score: 25 - 04/09/12 @ 13:31
/hu<CR>cfnDog<Esc>n.n.n.kb~Go<Esc>ZZ

0 comments


#147 Radek / qrczeno - Score: 26 - 05/08/12 @ 12:51
/H<CR>cfnDog<Esc>n.n.?h<CR>.hh~Go<Esc>ZZ

0 comments


#148 Esteban Ordano / eordano - Score: 27 - 04/28/11 @ 06:10
:%s/[hH]uman/Dog/g<CR>krdGo<Esc>ZZ

0 comments


#149 Teflon Ted t(β—•β€Ώβ—•t) / teflonted - Score: 27 - 05/30/11 @ 04:16
:%s/human/Dog/i<CR>kxid<Esc>5jo<Esc>ZZ

0 comments


#150 Arto Vuori / dhpe - Score: 27 - 08/31/12 @ 20:11
:%s/Human/Dog<CR>kcfndog<Esc>Go<Esc>ZZ

0 comments


#151 Dj Vimgolf / dj_vimgolf - Score: 28 - 12/31/11 @ 02:02
:%s/uman/og<CR>:%s/H/D<CR>krdGo<Esc>ZZ

0 comments


#152 Alishah Chator / alicharizard - Score: 28 - 06/11/14 @ 17:01
:%s/uman/og<CR>:%s/H/D<CR><Up>rdGo<Esc>ZZ

0 comments


#153 Brendan Taylor / beect - Score: 29 - 04/26/11 @ 21:00
:%s/uman/og/<CR>krd:%s/H/D<CR>Go<Esc>ZZ

0 comments


#154 Seth Miller / skigil - Score: 30 - 09/28/11 @ 19:27
:%s/[hH]/<BS>uman/Dog/<CR>krdGo<Esc>:wq<CR>

0 comments


#155 Toto l'haricot / nico_le_terribl - Score: 35 - 06/19/11 @ 03:54
:%s/Human/Dog<CR>:%s/human/doh<BS>g<CR>Go<Esc>ZZ

0 comments


#156 Andrew Michaud / andrewjmichaud - Score: 37 - 09/04/15 @ 20:59
VG:s/Human/Dog/<CR>kV:s/human/dog/<CR>Go<Esc>ZZ

0 comments


#157 kuri65536 / kuri65536 - Score: 46 - 04/23/11 @ 04:14
:%s/Human/Dog/s<BS>g<CR>:%s/human/dog/s<BS>g<CR>jjjjA<CR><Esc>:x<CR>

0 comments


#158 γ―γŸγ‘γ‚„γΎγŸγ‹γ— / htkymtks - Score: 52 - 04/22/11 @ 16:21
:<Up><Up>s/<BS><BS>%s/Human/Dog/g<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS>h<Right><Right><Right><Right><Right><Right><BS>d<CR>Go<Esc>:wq<CR>

0 comments


#159 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

159 active golfers, 382 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