Home Download Buy Blog Forum Support

auto complete php tag

auto complete php tag

Postby elygen on Wed Jan 30, 2013 4:19 pm

Is there a plugin that will append (php) when you type <?
That would just make my day :)
elygen
 
Posts: 1
Joined: Wed Jan 30, 2013 4:17 pm

Re: auto complete php tag

Postby dotzecker on Wed Jan 30, 2013 6:33 pm

It goes to the technical support!

But you could create a snippet

Code: Select all
<snippet>
    <content><![CDATA[
<?php
]]></content>
    <tabTrigger><?</tabTrigger>
    <scope>source.php</scope>
</snippet>

dotzecker
 
Posts: 1
Joined: Wed Jan 30, 2013 6:30 pm

Re: auto complete php tag

Postby britalb on Thu Jan 31, 2013 12:37 am

Hi All,

Seemed like an excellent suggestion, so I tried it, only to get an XML parsing error.

I found the following after a Google search:
http://sublimetext.userecho.com/topic/9 ... -a-period/

and emended the snippet to the following:
Code: Select all
<snippet>
   <content><![CDATA[
<?php ${1} ?>
]]></content>
   <tabTrigger>&lt;?</tabTrigger>
   <scope>source.php</scope>
</snippet>


As always, give it a name like "phptag.sublime-snippet," and save it to your Packages/User directory (or a subfolder - i.e. "/php").

Hope this saves someone some time! Thanks again for the great suggestion.

Brit
britalb
 
Posts: 2
Joined: Thu Jan 31, 2013 12:31 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 18 guests