Hi,
I often want to wrap some code block to an if statement. Example:
echo "XY";
$var = "something;
into
if (condition) {
echo "XY";
$var = "something;
}
Can I do that in Sublime Text 2 by a simple keyboard shortcut? I tried to create a sublime snippet (see below) but the $SELECTION variable contains beginning spaces so the indentation is wrong after applying the snippet.
[code]
<![CDATA[
if ($1) {
$SELECTION
}
]]>
php.if
source.php
[/code]
Thank you!