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

180 active golfers, 454 entries

Leaderboard (lowest score wins):
23
#151 - Jakob / @jajob

11/02/2014 at 08:10PM

23
#152 - Jake Eaton / @Jake__Eaton

02/28/2015 at 07:32AM

23
#153 - ltn614 / @ltn614

09/29/2015 at 08:16PM

24
#154 - Zak Johnson / @zakj

04/22/2011 at 02:57AM

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

06/09/2011 at 11:15PM

24
#156 - jacobcr / @jacobcr

08/24/2011 at 07:05AM

24
#157 - Daniel / @dbb0

02/20/2012 at 08:32PM

24
#158 - William Ott / @oddalot

04/12/2015 at 05:27PM

25
#159 - draft_val=3 / @draftcode

04/24/2011 at 08:00AM

25
#160 - Jacob Taylor / @jacobltaylor

08/24/2011 at 05:28PM

25
#161 - Jakub Arnold / @darthdeus

12/19/2011 at 03:52PM

25
#162 - Ibrahim Tencer / @ibrahimtencer

02/14/2012 at 12:09AM

25
#163 - Christian Helbling / @friendly_coder

04/09/2012 at 01:31PM

26
#164 - Radek / @qrczeno

05/08/2012 at 12:51PM

26
#165 - shahanavaz m / @shahanavazm

02/20/2022 at 10:47PM

27
#166 - Esteban Ordano / @eordano

04/28/2011 at 06:10AM

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

05/30/2011 at 04:16AM

27
#168 - Arto Vuori / @dhpe

08/31/2012 at 08:11PM

27
#169 - RockerZZY / @rocker_zzy

07/05/2020 at 03:02AM

28
#170 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 02:02AM

28
#171 - Alishah Chator / @alicharizard

06/11/2014 at 05:01PM

29
#172 - Brendan Taylor / @beect

04/26/2011 at 09:00PM

30
#173 - Seth Miller / @skigil

09/28/2011 at 07:27PM

33
#174 - Chris G / @AboutThatThing

06/12/2019 at 08:35AM

35
#175 - Toto l'haricot / @nico_le_terribl

06/19/2011 at 03:54AM

37
#176 - Andrew Michaud / @andrewjmichaud

09/04/2015 at 08:59PM

39
#177 - editor3D / @editor3D

11/13/2018 at 08:14PM

46
#178 - kuri65536 / @kuri65536

04/23/2011 at 04:14AM

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

04/22/2011 at 04:21PM

71
#180 - Jacob Rosenblatt / @JKRosenblatt

06/15/2014 at 04:02PM