I am doing a project where I have files which have markdown and perl in it. I would like to be able to syntax highlight both of them, is it possible in atom?
It is possible, but it is not perfect.
There is a well-written post about this on discuss.atom.io. Basically, you have to manually edit the language package (like language-markdown
or language-perl
) and add an extra grammar rule by referring to another language.
For example, adding
{
'begin': '`'
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin.coffee'
'end': '`'
'endCaptures':
'0':
'name': 'punctuation.definition.string.end.coffee'
'name': 'string.quoted.script.coffee'
'patterns': [
{
'include': 'source.js'
}
]
}
to language-coffee-script
enables syntax-highlighting of javascript between two instances of (`)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With