Home Download Buy Blog Forum Support

Stop from tabbing out of empty HTML tags

Stop from tabbing out of empty HTML tags

Postby justinwhall on Thu May 17, 2012 4:24 pm

I often open new HTML tags like so:

h1+tab wich results in:
Code: Select all
<h1>*cursor*</h1>


I then want to open a block of PHP. I've the following tab trigger configured php+tab =
Code: Select all
<?php *cursor* ?>


Problem is, sublime text want to tab out of the HTML tags leaving the unexecuted 'php' within the tags like so:
Code: Select all
<h1>php</h1>*cursor*
justinwhall
 
Posts: 13
Joined: Wed Feb 15, 2012 11:26 pm

Re: Stop from tabbing out of empty HTML tags

Postby C0D312 on Thu May 17, 2012 10:45 pm

This is because, in the keybindings, tabbing to the next tabstop takes precedence to expanding a snippet. Try adding the following to your user keybindings to override the defaults:
Code: Select all
   { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Stop from tabbing out of empty HTML tags

Postby justinwhall on Fri May 18, 2012 11:09 pm

Thanks. That works, but now I can't type h1+tab -> <h1>*cursor*</h1>
justinwhall
 
Posts: 13
Joined: Wed Feb 15, 2012 11:26 pm


Return to Technical Support

Who is online

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