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 537a553282aa3e000222048a

HTML formatting: vertical alignment for readability

We did this a VimGolf challenge at work and now that we have finished I want to see if you guys can come up with something even better than we could. Our best solution was 44 keystrokes.

Start file
<table>
<thead>
<th>
<th id="first_name">First Name</th>
<th id="last_name">Last Name</th>
<th id="address">Address</th>
<th id="city">City</th>
<th id="state">State</th>
<th id="zip_postal">Zip</th>
<th id="country">Country</th>
<th id="phone">Phone</th>
</th>
</thead>
</table>
End file
<table>
	<thead>
		<th>
		<th id="first_name"> First Name</th>
		<th id="last_name "> Last Name </th>
		<th id="address   "> Address   </th>
		<th id="city      "> City      </th>
		<th id="state     "> State     </th>
		<th id="zip_postal"> Zip       </th>
		<th id="country   "> Country   </th>
		<th id="phone     "> Phone     </th>
		</th>
	</thead>
</table>

View Diff

2,13c2,13
< <thead>
< <th>
< <th id="first_name">First Name</th>
< <th id="last_name">Last Name</th>
< <th id="address">Address</th>
< <th id="city">City</th>
< <th id="state">State</th>
< <th id="zip_postal">Zip</th>
< <th id="country">Country</th>
< <th id="phone">Phone</th>
< </th>
< </thead>
---
> 	<thead>
> 		<th>
> 		<th id="first_name"> First Name</th>
> 		<th id="last_name "> Last Name </th>
> 		<th id="address   "> Address   </th>
> 		<th id="city      "> City      </th>
> 		<th id="state     "> State     </th>
> 		<th id="zip_postal"> Zip       </th>
> 		<th id="country   "> Country   </th>
> 		<th id="phone     "> Phone     </th>
> 		</th>
> 	</thead>

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 24 remaining solutions by signing in and submitting your own entry
#25 Ram Tamtam / ramtamtamtam - Score: 90 - 06/30/14 @ 09:36
j>13Gj>12Gjf>a <Esc>qq+t>:norm <C-R>=21-col('.')<CR>i <CR>f>a <Esc>f<:norm <C-R>=34-col('.')<CR>i <CR>q6@qkki <Esc>^hhhxZZ

0 comments

#26 RobertT / techrt2050 - Score: 93 - 05/20/14 @ 17:29
:%s/">\([^<]*\)\(.*\)$/       "> \1        \2<CR>:se sw=8<CR>qq19|dt"32|dt<>>-q7@q.3L.jqq>>-q11@qZZ

0 comments

#27 james_bunch / james_bunch - Score: 98 - 05/20/14 @ 14:39
j>#j./F<CR>i <Esc>ylj4hp2lp9lpj14h3p2lp7l3pj11h6p2lp4l6pj12h5p2lp5l5pj8hp3l7pj14h3p2lp7l3pj12h5p2lp5l5pZZ

0 comments

#28 James / Dronak - Score: 112 - 09/18/14 @ 21:10
3jf>a <Esc>j3hi <Esc>f>a <Esc>f<i <Esc>+qt2f"3i <Esc>f>a <Esc>f<3i <Esc>q4+@t+qf2f"5i <Esc>f>a <Esc>f<5i <Esc>q3-@f-@fi <Esc>2Fya <Esc>/Z<CR>i <Esc>f<7i <Esc>2GVGk>jV9j>ZZ

Dronak: Not good, I know, but it gets a score on the board (I'm slowly trying to do all the challenges). Maybe I'll try again in the future and see if I can figure out the trick to this one.

1 comment

#29 Hendrik Lammers / hendriklammers - Score: 158 - 06/21/14 @ 13:55
j>13Gj>12G8G2f"i<Tab><Tab><Esc>ukkkea <Esc>jhhi   <Esc>jF"i      <Esc>jF"i     <Esc>ja<Esc>jF"i   '<BS><Esc>jF"i     <Esc>fP<C-V>6kkI <Esc>jlf<i <Esc>jF<i   <Esc>jF<i      <Esc>jF<i     <Esc>jF<i       <Esc>jF<i    <BS><Esc>jF<i     <Esc>ZZ

0 comments

#30 Dmitry Teslenko / krab_mozga - Score: 164 - 05/21/14 @ 12:55
jV11j>jV9j>jfFi<Tab><BS> <Esc>wwwi<Tab><BS><Esc>jF"i<Tab><BS> <Esc>wwi <Esc>wwwi<Tab><BS> <Esc>kjbbbjbb3i <Esc><Esc>jbb6i <Esc>jbb5i <Esc><Esc>jjb3i <Esc><Esc>j,F"5i <Esc><Esc>wll<C-V>kkkkkI <Esc><Esc>lw3i <Esc><Esc>jbb6i <Esc>jjkbb5i <Esc>jbb7i j<Esc>jui<Esc>li<Esc>l7i <Esc>jb3i <Esc>jbb5i <Esc><Esc>ZZ

0 comments

#31 Chris Davison / davisonnn - Score: 227 - 05/24/14 @ 23:25
2Gv13G>3Gv12G> /Fi <BS><BS><CR>i <Esc>kjjhhhi <Esc>llli l<Esc>xlllllllla <Esc>jhhhhhhhhhhhhha<Esc>i   <Esc>fAil<BS> <Esc>%fCjFChhi      <Esc>fCi k<BS><Esc>kfs;a   <Esc>jFya      <Esc>jF"i4 =<BS><BS><BS>     <Esc>fSi <Esc>fei<Right>     <Esc>jf"F"fZi <Right><Right><Right>       <Esc>jf"F"i   <Esc>fCi <Esc>fya   <Esc>jF"i     <Esc>fPi <Esc>fea     ZZ<BS><BS><Esc>ZZ

0 comments

Created by: kirk_bauer

31 active golfers, 59 entries

Leaderboard (lowest score wins):
33
#1 - Urtica dioica / udioica

05/19/2014 at 09:18PM

33
#2 - wizardwerdna / wizardwerdna

05/20/2014 at 04:05AM

33
#3 - John Braxler / braxler

05/20/2014 at 04:15PM

33
#4 - Petro Тrouq / zulolosi

05/20/2014 at 06:40PM

33
#5 - MP / Enemy_m

05/20/2014 at 06:53PM

33
#6 - Benoit d'Oncieu / bdoncieu

05/25/2014 at 07:42PM

33
#7 - Teodor Kotov / Microfed

05/28/2014 at 09:48PM

33
#8 - Robert Bruce / therealrobru

06/11/2014 at 11:23PM

33
#9 - playalong / playwithit42

07/16/2014 at 09:53AM

34
#10 - Benjamin Williams / benjaminjosephw

05/19/2014 at 09:41PM

36
#11 - pftb12345 / pftb12345

04/20/2015 at 02:29PM

36
#12 - Jon Krause / jkrause314

01/20/2016 at 06:48AM

38
#13 - Carlos A Henríquez Q / lagunex

03/01/2015 at 03:14PM

43
#14 - Markus Kasper / KasperBox

05/21/2014 at 02:40PM

45
#15 - vimgolf copycat / vimgolf_copycat

05/25/2014 at 11:49AM

45
#16 - Jon Nyman / NymanJon

09/12/2015 at 05:57PM

50
#17 - Kai Yuan / kentyuan

05/19/2014 at 11:22PM

54
#18 - Pedro Santos / pedrosans

05/19/2014 at 10:19PM

60
#19 - YAMADA Yukimi / edp02

06/27/2014 at 02:09PM

60
#20 - Juan-Lucas Picard / davidmh

09/09/2014 at 06:37AM

61
#21 - ryk / rykarn

05/23/2014 at 08:21PM

80
#22 - Carlos López / morrizon

05/21/2014 at 01:18AM

83
#23 - mnx / mnxx

06/12/2014 at 11:07AM

85
#24 - jolka / jolka19296078

05/22/2014 at 02:42PM

90
#25 - Ram Tamtam / ramtamtamtam

06/30/2014 at 09:36AM

93
#26 - RobertT / techrt2050

05/20/2014 at 05:29PM

98
#27 - james_bunch / james_bunch

05/20/2014 at 02:39PM

112
#28 - James / Dronak

09/18/2014 at 09:10PM

158
#29 - Hendrik Lammers / hendriklammers

06/21/2014 at 01:55PM

164
#30 - Dmitry Teslenko / krab_mozga

05/21/2014 at 12:55PM

227
#31 - Chris Davison / davisonnn

05/24/2014 at 11:25PM