Skip to content

Instantly share code, notes, and snippets.

@iansinnott
Created September 7, 2013 14:40
Show Gist options
  • Save iansinnott/6476131 to your computer and use it in GitHub Desktop.
Save iansinnott/6476131 to your computer and use it in GitHub Desktop.
I've included a description of what I hope this would do bellow, but I think the easiest way to solve this would just be to change the line of your code that includes the match() function. If I new regex this would probably be pretty easy to exclude the string 'php' from the match so that the function wouldn't run expansion if tab was hit after …
<html>
<head>
</head>
<body>
<!-- So when i'm in an html document like this and I want to start typing php, I will just type 'php' as bellow -->
<!-- The '_' marks where the cursor is when I hit the tab key -->
php_
<!-- Then I would want that to expand to the line bellow, placing the cursor in the newly opened php tag -->
<?php _ ?>
</bod>
</html>
@bling
Copy link

bling commented Sep 7, 2013

ok, that makes a lot more sense in what you're trying to do :-)

the simplest thing would be to add if match(line, 'php') > -1 to do something specifically for php.

i believe emmet itself can also be configured to define custom expansions like this, so consult its documentation for how to do it.

hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment