TextMate HTML bundle v.1.5

Sunday, May 3rd, 2009

TextMate HTML bundle is now mHTML

I just updated my TextMate HTML bundle to v.1.5. The main difference here is that it does not replace the default HTML bundle anymore, it is now a separate bundle that works as an addition to the default bundle. The advantage is that the original HTML Language and Preferences files are left untouched and it eliminates any potential conflicts with future TextMate updates.

Installation & Update

Because of the way TextMate works, to make sure you get a clean default HTML bundle and mHTML bundle, you’ll need to backup and delete any HTML bundle present in ~/Library/Application Support/TextMate/Bundles/ and/or ~/Library/Application Support/TextMate/Pristine Copy/Bundles/ first. Then install the mHTML bundle (double click it after unzipping).

How it works

Because it’s now its own bundle, I had to rework some of the tab triggers so they don’t trigger both snippets from the default HTML bundle and the mHTML bundle. The basic rule for the mHTML bundle is: all snippets are triggered with the 3 first letters of the element’s name. With one exception <table> (tab triggers the character code for a tab in the default HTML bundle)

What’s new

  • I rewrote all the commands in Ruby so they should be much easier to decipher and customize.
  • The table command will ignore multiple tabs, so each cell can be delimited by one or more tabs now. You can also have th added to first row or column.
  • The “navbar” command regex is a little smarter and will strip most punctuation from classes and URLs (not smart enough for accents though, it will strip those too).
  • The “clean up” command will remove most of the annoying invisible characters in Words documents that come out garbled in a browser, it will also strip multiple new lines and wrap paragraphs in <p> tags.
  • All snippets should be more consistent and I included the phrase and inline elements I arbitrarily previously left out…

What’s next?

If you’d like to see something added, or if you find a bug, let me know in the comments. Thanks!

Download

You can get the new version on the TextMate HTML bundle download page.

Filed under: HTML, TextMate, Updates