Home Download Buy Blog Forum Support

Tab complete PHP tags inside PHP

Tab complete PHP tags inside PHP

Postby web559 on Wed Sep 19, 2012 4:03 pm

I am in a PHP document. I type php[tab] and it expands to
Code: Select all
<?php | ?>
(where | is the cursor).

With my cursor inside the PHP tags, I would like php[tab] to close and reopen the PHP tags, like this:
Code: Select all

This behavior is default in TextMate but doesn't seem to be active in my SublimeText installation. How can I implement it?
Posts: 2
Joined: Thu Aug 16, 2012 10:42 pm

Re: Tab complete PHP tags inside PHP

Postby ChadW on Thu Sep 20, 2012 8:28 pm

This occurs because of a conflict between `tab' meaning "jump to the next spot in the code expansion" and `tab' meaning "use the current text to put in a new code expansion". As far as I can tell, the built-in nature of tab completion makes it impossible to preempt the former mechanic with the latter using the tab key. You can, however, use another mapping to get to the expansion (the dropdown list completion mechanism provides expansion possibilities, and the "use best expansion" mechanism [I forget the particular name] should work as you expect `tab' to).
Posts: 21
Joined: Fri Sep 23, 2011 7:45 pm

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 23 guests