Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Leaderboard, Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4fe3d2c2f73248000100004b

Changing URL path in CSS

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

Start file
body {
	background: #d47300 url(graphics/noise.png);	
	font-family: 'Open Sans', sans-serif;
}


.background {
	background: url(../images/background_shadow.png) no-repeat top center;
	background-position: 50% 16%;	
}

.background_overlay {
	background: url(../images/background_overlay.png) no-repeat top center;
	padding: 0;
	margin:0;
}


.order {
	background: #ff9e00 url(graphics/order.png) repeat-x;
	height: 25px;
	display: inline-block;
	color: #d47300;
	line-height: 25px;
	font-weight: 700;
	font-size: 13px;
	font-weight: 800;
	padding: 0 10px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
	text-transform: uppercase;
	color: #825600;
	text-shadow: 0px 1px 0px rgba(255,255,255,0.50);
}

.sponsor:hover {
	background-position: 0px -25px;
}

.sponsor:active {
	background: #ff9e00 url(../images/sponsors/sponsorBlock.png) repeat-x;
	background-position: 0px -50px;
}


.telephone {
	background: #fff url(graphics/telephone.png) repeat-x;
	height: 25px;
	display: inline-block;
	color: #A65A01;
	line-height: 25px;
	font-weight: 700;
	font-size: 14px;
	padding: 0 10px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
	text-shadow: 0px 1px 0px rgba(255,255,255,0.50);
}


.social {
	background: #fff url(../social/telephone.png) repeat-x;
	display: inline-block;
	height: 25px;
	line-height: 25px;
	padding: 0 10px;
	color: #A65A01;
	font-weight: 700;
	font-size: 14px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
}
End file
body {
	background: #d47300 url(/wp-content/themes/black/graphics/noise.png);	
	font-family: 'Open Sans', sans-serif;
}


.background {
	background: url(/wp-content/themes/black/images/background_shadow.png) no-repeat top center;
	background-position: 50% 16%;	
}

.background_overlay {
	background: url(/wp-content/themes/black/images/background_overlay.png) no-repeat top center;
	padding: 0;
	margin:0;
}


.order {
	background: #ff9e00 url(/wp-content/themes/black/graphics/order.png) repeat-x;
	height: 25px;
	display: inline-block;
	color: #d47300;
	line-height: 25px;
	font-weight: 700;
	font-size: 13px;
	font-weight: 800;
	padding: 0 10px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
	text-transform: uppercase;
	color: #825600;
	text-shadow: 0px 1px 0px rgba(255,255,255,0.50);
}

.sponsor:hover {
	background-position: 0px -25px;
}

.sponsor:active {
	background: #ff9e00 url(/wp-content/themes/black/images/sponsors/sponsorBlock.png) repeat-x;
	background-position: 0px -50px;
}


.telephone {
	background: #fff url(/wp-content/themes/black/graphics/telephone.png) repeat-x;
	height: 25px;
	display: inline-block;
	color: #A65A01;
	line-height: 25px;
	font-weight: 700;
	font-size: 14px;
	padding: 0 10px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
	text-shadow: 0px 1px 0px rgba(255,255,255,0.50);
}


.social {
	background: #fff url(/wp-content/themes/black/social/telephone.png) repeat-x;
	display: inline-block;
	height: 25px;
	line-height: 25px;
	padding: 0 10px;
	color: #A65A01;
	font-weight: 700;
	font-size: 14px;
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	box-shadow: 0 0 0px 5px rgba(0,0,0,0.10);	
	margin-right: 20px;
}

View Diff

2c2
< 	background: #d47300 url(graphics/noise.png);	
---
> 	background: #d47300 url(/wp-content/themes/black/graphics/noise.png);	
8c8
< 	background: url(../images/background_shadow.png) no-repeat top center;
---
> 	background: url(/wp-content/themes/black/images/background_shadow.png) no-repeat top center;
13c13
< 	background: url(../images/background_overlay.png) no-repeat top center;
---
> 	background: url(/wp-content/themes/black/images/background_overlay.png) no-repeat top center;
20c20
< 	background: #ff9e00 url(graphics/order.png) repeat-x;
---
> 	background: #ff9e00 url(/wp-content/themes/black/graphics/order.png) repeat-x;
43c43
< 	background: #ff9e00 url(../images/sponsors/sponsorBlock.png) repeat-x;
---
> 	background: #ff9e00 url(/wp-content/themes/black/images/sponsors/sponsorBlock.png) repeat-x;
49c49
< 	background: #fff url(graphics/telephone.png) repeat-x;
---
> 	background: #fff url(/wp-content/themes/black/graphics/telephone.png) repeat-x;
66c66
< 	background: #fff url(../social/telephone.png) repeat-x;
---
> 	background: #fff url(/wp-content/themes/black/social/telephone.png) repeat-x;

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 40 remaining solutions by signing in and submitting your own entry
#41 Underhill Labs / @underhilllabs - Score: 53 - 10/29/12 @ 22:40
:%s/l(/l(\/wp-content\/themes\/black\//<CR>:%s/\.\.\/<CR>ZZ

0 comments

#42 無ん垢の叫び / @john_ababa - Score: 54 - 09/16/12 @ 00:00
:%s,(g,(/wp-content/themes/black/g<CR>:<C-P><BS><BS><Home><Right><Right><Right><Del><Del>\.\.<Right><Del><CR>ZZ

0 comments

#43 Chris LeBlanc / @cleblanc87 - Score: 56 - 11/02/12 @ 08:43
:%s/l(/l(\/wp-content\/themes\/black\/<CR>:%s/\.\.\//<CR>:w<CR>ZZ

0 comments

#44 vgromainl / @vgromainl - Score: 62 - 07/23/12 @ 15:02
:%s/<BS>;\.\./;;<CR>:g/url/norm f(aw<BS>/wp-content/the<BS>emes/black/<CR>:x<CR>

0 comments

#45 Samuel Ytterbrink / @Neppord - Score: 66 - 06/22/12 @ 18:29
:%s%url(\(../\|\)\(.\{-}\))%url(/wp-content/themes/black/\2)%<CR>:wq<CR>

0 comments

#46 Dustin Willis Webber / @Mephux - Score: 66 - 08/28/12 @ 09:21
:%s/\(url(\.\.\/\)\|url(/url(\/wp-content\/themes\/black\//g<CR><Esc>:wq<CR>

0 comments

#47 Ryan O'Connell / @Salshammath - Score: 68 - 06/21/12 @ 19:05
:%s#\v(url\()@<=(\.\.)=/=(.{-})\)@=#/wp-content/themes/black/\3<CR>:<BS>ZZ

0 comments

#48 Veezus Kreist / @veezus - Score: 69 - 07/17/12 @ 11:54
/pn<CR>qmF(a/wp-content/themes/black/<Esc>jqn@mn@@n@@n@@n@@n@@:%s/\.\.\//<CR>ZZ

0 comments

#49 Brett Lischalk / @blischalk - Score: 342 - 07/13/12 @ 18:16
:%s/graphics//wp-content/themes/black/<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right>\<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>\<Right><Right><Right><Right><Right><Right><Right>\<Right><Right><Right><Right><Right><Right><Right>graphics/g<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>\<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><BS><BS><BS>\.\.\/social<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><BS><BS><BS><BS><BS><BS>social<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><BS>images<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><BS><BS><BS><BS>images<CR>l<Esc><Esc>:wq<CR>

0 comments

#50 Noel Alejandro / @noelrock333 - Score: 435 - 06/22/12 @ 14:39
:$<BS>%S<BS>s,/<BS>l*<BS>(8<BS>[.](<BS>*,-<BS>l(wo<BS>p-wo<BS><BS>content.<BS>/themes.<BS>/black><BS><CR>>><BS><BS><<<BS><BS>ZZ<CR><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down>u:%s.<BS>,8<BS>l(<Esc>[<Esc>:%s,l([./]*,<BS>.<BS>,l(con=<BS><BS><BS><BS>wp-content<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right>/<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>/thee<BS>mes.<BS>/black<Right><CR>jjjjjjjjjjjjjjjjjjjjj}{{{{{{{{{{{{}}}}}}}}}}u%:%s,usl<BS><BS>rl([]<Left>./<Right><Right>.<BS><Left><Left>.<Right><Right><Left><Left><BS><Right><Right><Right>><BS>*,<<BS>*<BS><<BS>url(/content<BS><BS><BS><BS><BS><BS><BS>wp/<BS>-co<BS><BS>content-<BS>.<BS>/themes-<BS>/black/<CR>kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk><Esc>:w<CR><Esc><C-W>q

0 comments

Created by: @Salshammath

50 active golfers, 98 entries

Leaderboard (lowest score wins):
Q6hrg93p4r3hn56thmd0_normal
40
#1 - Urtica dioica / @udioica

06/21/2012 at 07:32PM

T_e_normal
40
#2 - Tim Chase / @gumnos

06/21/2012 at 07:40PM

P1000007_normal
40
#3 - h_east (DDD ready) / @h_east

06/21/2012 at 09:38PM

40051_789281885907_29616532_44170636_2091417_n_normal
40
#4 - Conner McDaniel / @connermcd

06/21/2012 at 10:24PM

Ich_neu_normal
40
#5 - Tibor Claassen / @codebeige

06/21/2012 at 11:08PM

Jlove201003sq_normal
40
#6 - Justin Love / @wondible

06/22/2012 at 07:23AM

Fepic_normal
40
#7 - Federico Galassi / @federicogalassi

06/22/2012 at 10:41AM

Self-avatar-2009_normal
40
#8 - John Whitley / @johnwhitley

06/22/2012 at 12:40PM

Face_normal
40
#9 - proglottis / @proglottis

06/23/2012 at 03:20AM

Sy18fa3i4y5qmtvzg7qu_normal
40
#10 - ☈king / @SharpsawDotOrg

06/23/2012 at 09:04PM

8vhfldr8_normal
40
#11 - Ricardo Mendes / @locks

06/25/2012 at 11:30AM

Wombat-large_normal
40
#12 - mwatkward / @AftrschoolSpe

06/27/2012 at 06:32AM

100_0478_normal
40
#13 - Kaleb Hornsby / @thekaleb

07/14/2012 at 06:01PM

Ich_normal
40
#14 - Daniel S / @smatter0ne

07/15/2012 at 03:29PM

312189_10150481221796258_700041257_11172966_434509532_n_normal
40
#15 - Sean Griffin / @sgrif

08/12/2012 at 06:06PM

Fireshot_pro_capture__014_-__google______1000____-_www_google_com_reader_view__stream_feed_2fhttp_3a_2f_2ffeed_feedsky_com_2fmedowo_normal
40
#16 - 刘玮 / @lwjef

08/16/2012 at 06:41PM

Me_normal
40
#17 - Sune Simonsen / @sunesimonsen

08/26/2012 at 02:31AM

0eac0267dbe74aebf3c8129f2e65accd_normal
40
#18 - mhb / @mhbvim

09/24/2012 at 04:02AM

Default_profile_3_normal
40
#19 - Édouard M'tou / @DouardM

10/09/2012 at 02:41AM

4654945923_eb2c60ee5f_normal
42
#20 - Kerson Hsiao / @KersonHsiao

06/21/2012 at 11:37PM

Avatar-new2_normal
42
#21 - Vitaly Kushner / @vkushner

06/22/2012 at 04:22AM

Photo_2_normal
42
#22 - Caleb McDaniel / @wcaleb

07/25/2012 at 07:44PM

Default_profile_6_normal
42
#23 - William Dunand / @wdunand

08/02/2012 at 10:32PM

Default_profile_3_normal
43
#24 - James Davis / @tripvg

08/04/2012 at 08:50PM

Fxjqeo1fxqhkf2i965qh_normal
43
#25 - Reed Riley / @ReedRile

08/13/2012 at 11:27AM

Arneicon-128-print_normal
43
#26 - Arne Ehrlich / @typedlambda

09/05/2012 at 02:43PM

Default_profile_0_normal
44
#27 - Pandae / @psasqw

06/22/2012 at 02:22AM

6472418b96219199d9f0f4d71e7c068f_normal
44
#28 - Matt Walker / @_walkermatt

07/18/2012 at 05:16AM

David-icon_normal
44
#29 - David Galeano / @davidgaleano

07/19/2012 at 01:22PM

Avatar_normal
45
#30 - Øystein Walle / @oysteinwalle

06/25/2012 at 01:35PM

Av_normal
45
#31 - Vasil Sakarov / @vsakarov

06/26/2012 at 06:54AM

Emblemofroto_normal
45
#32 - Glen / @Glen_S

07/22/2012 at 11:06PM

B161e1c4bdeba89a614d43bdf8563bab_normal
45
#33 - Théophile Wallez / @twallez

08/11/2012 at 10:24AM

Avatar-aa-96_normal
46
#34 - Mahefa Randimbisoa / @DotMG

07/04/2012 at 04:30AM

Domon_64_normal
46
#35 - Domon / @Domon

09/11/2012 at 03:16AM

En-face_normal
49
#36 - Lajos Koszti / @Ajnasz

06/23/2012 at 06:27AM

Default_profile_4_normal
49
#37 - Martin Petrov / @mgpetrov

08/23/2012 at 05:53AM

3hrkqpt87oaselzo9qiu_normal
50
#38 - Michael Limiero / @michaellimiero

08/13/2012 at 02:52PM

Brent-avatar_normal
50
#39 - S. Brent Faulkner / @sbfaulkner

09/14/2012 at 09:39AM

Me-compressed_normal
53
#40 - Christopher Green / @cg433n

07/06/2012 at 06:06AM

Knittingstash_240dpi_72x72_normal
53
#41 - Underhill Labs / @underhilllabs

10/29/2012 at 10:40PM

Bc879469f279ee24b7fbdfad7c2216d9_normal
54
#42 - 無ん垢の叫び / @john_ababa

09/16/2012 at 12:00AM

Favicon_normal
56
#43 - Chris LeBlanc / @cleblanc87

11/02/2012 at 08:43AM

Default_profile_6_normal
62
#44 - vgromainl / @vgromainl

07/23/2012 at 03:02PM

Msn4_normal
66
#45 - Samuel Ytterbrink / @Neppord

06/22/2012 at 06:29PM

4547f77730a1dcf64d10f842cd1f2042_normal
66
#46 - Dustin Willis Webber / @Mephux

08/28/2012 at 09:21AM

Wideeyes_normal
68
#47 - Ryan O'Connell / @Salshammath

06/21/2012 at 07:05PM

Photo_on_2009-11-16_at_19.59_reasonably_small_normal
69
#48 - Veezus Kreist / @veezus

07/17/2012 at 11:54AM

Blpqr_normal
342
#49 - Brett Lischalk / @blischalk

07/13/2012 at 06:16PM

Nuevo-1_normal
435
#50 - Noel Alejandro / @noelrock333

06/22/2012 at 02:39PM