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

36 active golfers, 88 entries

Leaderboard (lowest score wins):
112
#31 - James / @Dronak

09/18/2014 at 09:10PM

141
#32 - Josh Kermond / @Kermond

08/23/2020 at 06:43AM

143
#33 - Hector Bjernersjö / @HectorBjernersjo

07/10/2024 at 04:05PM

158
#34 - Hendrik Lammers / @hendriklammers

06/21/2014 at 01:55PM

164
#35 - Dmitry Teslenko / @krab_mozga

05/21/2014 at 12:55PM

227
#36 - Chris Davison / @davisonnn

05/24/2014 at 11:25PM