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 594db7f41ba5d60135000005

Text to HTML Table

Turn the plain text table to an HTML table.

Start file
012
345
678
9ab
cde
 f 
End file
<table>
	<tr><td>0</td><td>1</td><td>2</td></tr>
	<tr><td>3</td><td>4</td><td>5</td></tr>
	<tr><td>6</td><td>7</td><td>8</td></tr>
	<tr><td>9</td><td>a</td><td>b</td></tr>
	<tr><td>c</td><td>d</td><td>e</td></tr>
	<tr><td> </td><td>f</td><td> </td></tr>
</table>

View Diff

1,6c1,8
< 012
< 345
< 678
< 9ab
< cde
<  f 
---
> <table>
> 	<tr><td>0</td><td>1</td><td>2</td></tr>
> 	<tr><td>3</td><td>4</td><td>5</td></tr>
> 	<tr><td>6</td><td>7</td><td>8</td></tr>
> 	<tr><td>9</td><td>a</td><td>b</td></tr>
> 	<tr><td>c</td><td>d</td><td>e</td></tr>
> 	<tr><td> </td><td>f</td><td> </td></tr>
> </table>

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 44 remaining solutions by signing in and submitting your own entry
#45 杨洋 / @176795444 - Score: 84 - 07/01/17 @ 03:12
:%s#.#<td>&</td>#g<CR>:%s#.*$<BS>#<tr>&</tr>#l<BS><CR>o<table<BS><BS><BS><BS><BS>/table><C-O>gg<table><CR>s<BS><C-C><C-C><C-C><C-C>V5j>ZZ

0 comments


Created by: @tpenguinltg

45 active golfers, 156 entries

Leaderboard (lowest score wins):
58
#31 - Michael Brown / @mbrown1413

07/06/2017 at 05:03PM

59
#32 - Anne Pacalet / @_Anne_P

07/11/2017 at 11:16AM

60
#33 - Anoop Kumar / @anooplive

06/24/2017 at 02:10AM

61
#34 - Gurukandhamoorthi / @Gurukandhamoor1

07/09/2017 at 05:51PM

62
#35 - grigouille / @grigouille2

06/25/2017 at 04:07PM

63
#36 - Lifepillar / @lifepillar

06/25/2017 at 08:17AM

64
#37 - Lukas Galke / @_lpag

06/25/2017 at 10:24PM

65
#38 - Michael Rees / @reesmichael1

06/25/2017 at 03:05AM

66
#39 - dadav 🥀 / @__dadav__

08/18/2017 at 07:18PM

68
#40 - Jurica / @Jurica34581259

11/20/2018 at 10:27PM

69
#41 - Dax / @zacoxi

12/13/2018 at 09:54AM

73
#42 - Tomas Sikula / @tomsmicroblog

06/25/2017 at 04:13PM

75
#43 - majo senf / @majo_senf

07/05/2019 at 09:31AM

81
#44 - RockerZZY / @rocker_zzy

07/03/2020 at 12:19AM

84
#45 - 杨洋 / @176795444

07/01/2017 at 03:12AM