Sublime Forum

Stop from tabbing out of empty HTML tags

#1

I often open new HTML tags like so:

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

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

Problem is, sublime text want to tab out of the HTML tags leaving the unexecuted ‘php’ within the tags like so: <h1>php</h1>*cursor*

0 Likes

#2

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:

	{ "keys": "tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
0 Likes

#3

Thanks. That works, but now I can’t type h1+tab ->

cursor

0 Likes