TextMate Txt2tags Bundle

If you’re one lucky guy/girl that owns a copy of the excellent TextMate text editor, listen on and prepare the “Hooray!”.

I’m a recently converted TextMate user and as you may wonder, to edit txt2tags files is part of my everyday routine. Websites, articles and books, everything is t2t-marked.

For a few days I’ve used TextMate on the “black & white mode” and that was real unsexy. A decade of Vim hardcore use told me that syntax highlight is a Good Thing.

I’m the Great Cornholio! I need some T.P. for my Bundle!

For my total surprise, the making of the TextMate Txt2tags Bundle was a breeze. It’s damn easy to add the syntax rules and as the regexes format are similar to Python’s, it was a copy & paste dream.

t2tmate Syntax Highlight

Since I was there, I just couldn’t stop.

Besides the colors for the txt2tags markup, we also have:

  • Tab Triggers for all the marksJust type the mark’s character and hit Tab. For example, to start a bold sentence, hit “*” followed by a Tab. It will expand to “****“, with the cursor right at the middle, waiting for your words to be inserted. Very handy!
  • Keyboard ShortcutsStill on the bold example, you can select your words and press Command-B. They’ll be surrounded by the “**” marks. Quick comment/uncomment a block of lines with Command-/ and move quotation in and out with Command-] and Command-[.

    To type a link, it’s even cooler. First, copy the desired URL to the clipboard (Command-C, you know). Then type Control-Shift-L and the link mark will appear, with the URL already filled. Type the link name and press Tab to leave the mark. Killer!

    You can also select some already-typed text, press Control-Shift-L and see it being linked without any typing. The same works for titles, images and even tables (just Tab-delimit your data and press Control-Shift-|).

    Press Command-Esc at any time to get the key listing:
    t2tmate Keyboard Shortcuts

    Tip: Use keyboard shortcuts for selected text, use tab triggers for to-be-typed text.

  • Tab Triggers for all settings and macrosNever read the Txt2tags User Guide anymore. Just type the setting name followed by a Tab to have all it’s arguments shown. And what about those funky “%Y %m” for the %%date macro? No problem, type “date” and hit Tab.
  • Drag’n’drop supportImages, other txt2tags files and HTML files. Just drag them to the editor and watch the magic happening!
  • Ready-to-use template for UNIX man pagesLoad the template, fill your program’s data and there it is: you have a full featured man page. To start, choose File > New From Template > Txt2tags > Manual Page (man).
  • Painless conversion processThere are several shortcuts to automate the conversion process and see the results.
    • Under the “Convert to…” menu you can convert your document to any txt2tags-supported format with a single click.
    • Press Control-Option-Command-P (Wow, that hurts to type, but it’s easy to press) to get an instant clear text-only version of your document, just in case the markup is stealing your attention.
    • My favorite: press Control-Command-P to convert the file to HTML and open it in Safari (or your other default browser). It avoids the boring save-convert-switch-reload every time you’re editing your site pages.

Check out the full bundle menu expanded to finally shout your Hooray!:

t2tmate Menu

That’s it! Download and double click to install.

7 responses to “TextMate Txt2tags Bundle

  1. Congratulations! This is great!

    And the Windows users can also use this bundle with “e” editor (http://www.e-texteditor.com/). It use the same bundles of TextMate.

    [ ]’s

  2. It’s a shame that there’s no such thing for linux.

    TextMate looks really good, but I promised myself I’d stick with FOSS only, so where’s this bundle for vim? :)

  3. great job, and thanks :) The link to the zip file is down though, can you pls let me know when you have the link up.

    As it often happens, it was something else that i was looking for that brought me to this web-page. Since you seem to be a seasoned t2t user, you can perhaps answer my query. I’m preparing a small report which contains blocks of shell commands. Naturally, i want these blocks to appear in monospace font. I can do
    “$ command_1 in block_1“
    “$ command_2 in block_1“
    etc. Note that the `$’ is the shell-prompt.

    Is there is better way to format the code-block without having to use those double tick-marks in each line?

    Hoping that you can help me with this… Thanks :)

  4. Hello Ritesh,

    I’ve fixed the ZIP file link, thanks!

    The code-block you want is already implemented in txt2tags, just open/close it with three consecutive tick-marks:

    ```
    $ command 1
    $ command 2
    $ command 3
    $ command 4
    ```

    Bye

  5. Thanks a lot Aurelio, this looks really neat :) It’s my first foray into TexMate, so i’ll take some time to appreciate the app. However, i can already see how much more pleasing it is going to be editing .t2t code, compared to what i’ve been using on vim/linux …

Leave a comment