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 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 63 remaining solutions by signing in and submitting your own entry
#64 Noel Alejandro / @noelrock333 - Score: 435 - 06/22/12 @ 21: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

64 active golfers, 143 entries

Leaderboard (lowest score wins):
44
#31 - Pandae / @psasqw

06/22/2012 at 09:22AM

44
#32 - Matt Walker / @_walkermatt

07/18/2012 at 12:16PM

44
#33 - David Galeano / @davidgaleano

07/19/2012 at 08:22PM

45
#34 - Øystein Walle / @oysteinwalle

06/25/2012 at 08:35PM

45
#35 - Vasil Sakarov / @vsakarov

06/26/2012 at 01:54PM

45
#36 - Glen / @Glen_S

07/23/2012 at 06:06AM

45
#37 - Théophile Wallez / @twallez

08/11/2012 at 05:24PM

45
#38 - Matt / @mcr05

12/12/2014 at 11:34AM

45
#39 - Paul McDowell / @etothepi16

06/16/2024 at 04:41PM

46
#40 - Mahefa Randimbisoa / @DotMG

07/04/2012 at 11:30AM

46
#41 - Domon / @Domon

09/11/2012 at 10:16AM

46
#42 - Anton de Regt / @antonderegt

10/25/2024 at 01:15PM

47
#43 - Oliver Christ / @0liverChrist

11/04/2013 at 01:15PM

48
#44 - Joonas Pihlajamaa / @jokkebk

03/16/2014 at 06:52PM

49
#45 - Lajos Koszti / @Ajnasz

06/23/2012 at 01:27PM

49
#46 - Martin Petrov / @mgpetrov

08/23/2012 at 12:53PM

50
#47 - Michael Limiero / @michaellimiero

08/13/2012 at 09:52PM

50
#48 - S. Brent Faulkner / @sbfaulkner

09/14/2012 at 04:39PM

53
#49 - Christopher Green / @cg433n

07/06/2012 at 01:06PM

53
#50 - Underhill Labs / @underhilllabs

10/30/2012 at 05:40AM

54
#51 - じょんあば / @john_ababa

09/16/2012 at 07:00AM

54
#52 - James / @Dronak

09/19/2014 at 11:25PM

56
#53 - Chris LeBlanc / @cleblanc87

11/02/2012 at 03:43PM

57
#54 - shahanavaz m / @shahanavazm

03/21/2024 at 05:08PM

62
#55 - vgromainl / @vgromainl

07/23/2012 at 10:02PM

66
#56 - Samuel Ytterbrink / @Neppord

06/23/2012 at 01:29AM

66
#57 - Dustin Willis Webber / @Mephux

08/28/2012 at 04:21PM

68
#58 - Ryan O'Connell / @Salshammath

06/22/2012 at 02:05AM

69
#59 - Veezus Kreist / @veezus

07/17/2012 at 06:54PM

69
#60 - Kanmuruuruu / @Kanmuruuruu

04/07/2024 at 09:05AM