I like to add a heading syntax in my code files so that two or more # are treated as entities (therefore appearing in the Goto Anything panel). I would also like to detect when a word is surrounded in asterisks *. This is what I have so far (but it doesn’t work):
contexts:
main:
- match: ' *#{2,} .*$\n?' # headers
scope: entity.name.function
push:
- match: '\*(.+)'
captures:
1: keyword.bold
- match: '\*'
pop: true
- match: (#).*$\n? # regular comments
scope: comment.line.number-sign.r