Skip to content

Instantly share code, notes, and snippets.

@command-tab
Created October 23, 2020 23:14
Show Gist options
  • Save command-tab/f71964ad47e3ab78cd9deef42a5d85dd to your computer and use it in GitHub Desktop.
Save command-tab/f71964ad47e3ab78cd9deef42a5d85dd to your computer and use it in GitHub Desktop.
Install the pug tmbundle, then edit the built-in HTML bundle to append this above the style pattern
{ begin = '(^[ \t]+)?(?=<(?i:template lang="pug")(?!-))';
end = '(?!\G)([ \t]*$\n?)?';
beginCaptures = { 1 = { name = 'punctuation.whitespace.embedded.leading.html'; }; };
endCaptures = { 1 = { name = 'punctuation.whitespace.embedded.trailing.html'; }; };
patterns = (
{ name = 'meta.embedded.block.html';
begin = '(?i)(<)(template)(?=\s|/?>)';
end = '(?i)((<)/)(template)\s*(>)';
beginCaptures = {
0 = { name = 'meta.tag.metadata.pug.start.html'; };
1 = { name = 'punctuation.definition.tag.begin.html'; };
2 = { name = 'entity.name.tag.html'; };
};
endCaptures = {
0 = { name = 'meta.tag.metadata.pug.end.html'; };
1 = { name = 'punctuation.definition.tag.begin.html'; };
2 = { name = 'source.pug'; };
3 = { name = 'entity.name.tag.html'; };
4 = { name = 'punctuation.definition.tag.end.html'; };
};
patterns = (
{ name = 'meta.tag.metadata.pug.start.html';
begin = '\G';
end = '(>)';
captures = { 1 = { name = 'punctuation.definition.tag.end.html'; }; };
patterns = ( { include = '#attribute'; } );
},
{ name = 'source.pug';
begin = '(?!\G)';
end = '(?=</(?i:template))';
patterns = ( { include = 'source.pug'; } );
}
);
},
);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment