Last Updated: February 25, 2016
·
2.678K
· jgillman

Text Header snippet for Sublime Text

I was just playing around with snippets in Sublime Text for the first time (despite being a long time Sublime user). This was just for fun but it's useful and shows off how powerful the snippets can be.

<snippet>
  <content><![CDATA[##${1/./#/g}#
# ${1:header}
##${1/./#/g}#]]></content>
  <tabTrigger>thead</tabTrigger>
</snippet>

Just type thead and hit tab and you'll be presented with:

#########
# header
#########

Not super special yet, but while header is still highlighted try typing in your text header and it auto-magically expands to the right width. I'm sure someone could add to it to make it accept hard returns as well!

#########################
# always one step ahead!
#########################

1 Response
Add your response

This is fantastic. Thanks!

over 1 year ago ·