Edit the TextMate Comment Banner Snippet

TextMate is a great text editor and one of the key commands I use a lot is for inserting comment headers or banners. They auto expand to suit whatever text you use in place of the highlighted word “Banner”.

They look like this by default (using ctrl + shift + b):

/* ========= */
/* =  Banner = */
/* =========*/

I prefer this:
/* ==== Banner ==== */

To edit the banner, go to Bundles > Bundle Editor > Show Bundle Editor. From here go to Source and find the snippet for “Insert Comment Banner”.

This is the code I used to style my comment banner:
${TM_COMMENT_START/s*$/ /}==== ${1:${TM_SELECTED_TEXT:Banner}} ====${TM_COMMENT_END/s*(.+)/ $1/}

other page

What do you think?

It's good to talk!

Your email address will not be published. Required fields are marked *