I am trying to have syntax highlighting for when I have some HTML wrapped by the backticks.
Currently, looks like this:
A bit of context: this is an angular 1.5 component, with inline templating. I have the babel plugin and tried many different themes without success. ST3 3107.
Help and thanks in advance.
Here is a quick example of getting HTML highlighting working within template strings.
In ST just do: Tools > Developer > New Syntax
and paste the following from very start of Angular 2 sublime syntax file · GitHub
That should get you started!
Saved it has something.yaml . What am I missing here in order to activate it ?
save it as .sublime-syntax
Worked! Thanks. Gonna integrate with Babel Sublime syntax now.
Hey @subhaze the tip was great and it works but now the linter stopped working.
Is it possible to tell the linter that the new syntax is also JavaScript?
I’m not sure, I would think so but I don’t use linters within Sublime.
agoago
December 10, 2016, 5:09am
8
I tried this and it wouldn’t work.
Here is how I did it
I have 2 questions.
Where to save this file to?
How to actually activate this?
If you’re using SublimeLinter for linting, just add this syntax to syntax_map field in your SublimeLinter settings like this:
{
"user": {
"syntax_map": {
"javascript ng": "javascript"
}
}
}
select_
February 3, 2017, 4:27pm
10
Thanks for the answer but it just does not seem to have an effect. Is there anything I can do to debug this?
Hmm, check your .sublime-syntax file for name field, and then put lowercased value of this field to syntax_map definitions in your SublimeLinter config. So, in my case:
# JavaScript (Tagged Templates.sublime-syntax)
name: JavaScript (Tagged Templates)
# SublimeLinter.sublime-settings
{
"user": {
# other settings...
"syntax_map": {
# other settings...
"javascript (tagged templates)": "javascript"
}
}
}