Sublime Forum

Php tag shortcut not available in unclosed tags


Hi All, been using ST3 for a while now and love it.
This recent update is causing an issue that I cant find the problem for let alone a solution. Maybe I am not following convention, I am open to criticism/pointers.

In a php file, if i write
php TAB I get <?php ?> and thats fine

if I go on to write

<?php foreach($my_array as $key => $val){ ?>

I cant just type php TAB and get <?php ?> between the line above and below in this example

<?php }?>

BUT if I do the following

<?php foreach($my_array as $key => $val): ?>

It works fine in here. php TAB creates <?php ?>

<?php endif; ?>

This always used to work until the recent update.

Any help would be really appreciated.



  1. Install PackageResourceViewer if it is not already installed
  2. Open the Command Palette
  3. Type PRV: O and select PackageResourceViewer: Open Resource
  4. Select PHP
  5. Select Snippets/
  6. Select php.sublime-snippet
  7. Change <scope>embedding.php text.html - source.php</scope> to <scope>embedding.php text.html - (source &amp; - source text.html)</scope>
  8. Save it
1 Like


Total Genius, Its Ovs a Keith thing :slight_smile: thanks dude



BTW, some more advice from one Keith to another :wink:

when the next build of ST3 comes out, you might find that this has been fixed, maybe even in a different way. It is a good idea to remove the file you created, so that you receive any official changes made to it, in case it affects other functionality in future. To do this, you can go to the Preferences menu -> Browse Packages -> PHP -> Snippets and find the php.sublime-snippet file and delete it :slightly_smiling:

Otherwise your version of the file will take precedence, essentially overriding the version that comes with ST3, and it won’t be obvious why something is working differently for you than it is for everyone else :wink: