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

Follow comments via RSS feed

Comments on this article

  1. Thanks! Quality stuff as usual!

    Bradley Griffiths, on 2009.05.04

  2. I saw your screencast this morning and I loved every minute of it. What’s more, after trying out both HTML and CSS bundles, I gotta express my many congratulations and sincere thanks for the time and work you put into this. Thank you for sharing these bundles with the community. They rock!

    p.s. by the way, those ‘things’ between border-top and such, are called ‘dashes’ (or ‘dash’ in singular). Your English is very good, I understood very clearly.

    Robert Valencia, on 2009.07.27

  3. Thank you so much!

    I’ve been working towards a similar thing but more chaotic.

    Thank you for putting in the effort to save mine and others time.

    Reece, on 2009.09.17

  4. Thanks for sharing! You HTML and CSS bundle is awesome :)

    Renato Carvalho, on 2009.10.21

  5. Thanx for making this available and posting the screencast. Very generous!

    steven, on 2009.11.08

  6. Hi this is great!! One problem. The Clean Text menu item doesnt show up in the block menu. Also, the clean text + p action doesnt actually clean the text. Am I missing something? (Snow leopard perhaps?)

    Scott, on 2009.11.17

  7. This is so nice. Great work and as stated before thank you so much for sharing.

    Joe, on 2009.11.25

  8. I’m loving the bundle! Thanks.

    Jay, on 2009.12.15

  9. I like you mHTML and mCSS bundles but i found something recently that is killer when combined with your bundles. It’s called Zen Coding. Pure epicness: http://bit.ly/dO2mSJ Hope you enjoy! ^_^

    Vladimir krasko, on 2011.04.21

  10. I really love these, thank you for sharing this and the css bundle. One small request, can you send me bundle code for the ‘clean up’ command, it’s not showing up in the block element menu. Thanks!

    Curtis, on 2011.08.09

  11. How cool is this!? You have undoubtedly saved me time so I can learn other stuff and keep my boss+clients happy that the projects are completed at lightning speed. Man, I thought I was fast before!!!

    This + firebug are my two supersonic weapons!

    AWESOME!

    Dave Powell, on 2011.09.02

Leave a comment

HTML is not allowed and will be filtered out. You can use Markdown for formating;
mandatory fields are marked with *