Sublime Forum

Stop automatic indent for certain lines in snippets?

#1

Is there a way in sublime text to make it so that snippets, or parts of snippets are not automatically indented with the rest of the text?

My example is this:

[code]
<![CDATA[
echo <<<${2:UPDATE}

${2:UPDATE};
flush();
]]>
[/code]

As you can see, the snippet is mainly a heredoc in php. However, as heredocs in PHP require that the closing identifier is in the first column of the file, I run into problems with this when I call the snippet while not inside the first column.

The only current workaround I can figure out is to add an edit just before the heredoc closing identifier line so that I can delete all the indentation manually (and somewhat easily).

Does anyone know a way to specify that the closing identifier line not be indented (note that I do actually want the automatic indentation everywhere else in the editor, just not on the closing line of the heredoc.

0 Likes