Escape * and _ to prevent text from being made bold/italic?
Hi, I noticed that if I use * in a heading line, syntax highlighting stops for some reason.
I'm using an asterisk in line 29 (relatively-numbered) in the attached image.

Edit: This was happening because there was a *.c in the heading which notes interprets it as the start of bold text and everything till the end of the file was made bold.
Is there a way to escape the * and _ characters?
Is this still relevant, I cannot reproduce the error
The new question is if there's a way to escape * and _ to prevent text from being made bold/italic?
A backslash for escaping will be a pretty good feature.
The new question is if there's a way to escape
*and_to prevent text from being made bold/italic?
Right now there is no explicit way to do this. I see several potential options:
- Disable inline styles in headings (probably someone out there considers this a feature ;-).
- Try to change the patterns for inline styles so they only match if a "closing symbol" is used in the same "paragraph" (heading in this case). If no "closing symbol" is used the "opening symbol" would lose its special meaning. This might be the most intuitive behavior but I'm not sure how easily Vim's pattern matching can be pushed to do this.
- Provide an escape sequence like a backslash. I guess the backslash would have to be hidden using concealing, otherwise the effect would be rather awkward. But I'm pretty sure someone will complain about this as well, e.g. because backslashes in pathnames are common on Windows.
Any preferences or thoughts about these or other options?
Hmm, interesting choices.
1 - I guess this would be simplest option. Since, heading already has special status, I don't see any point in making text in a heading bold/italic etc.
2 - Does paragraph have its usual meaning? If yes, then it won't work in the following example since vim considers the two lines to belong to the same paragraph. However, if you restrict it to Vim's definition of sentence, then it will.
# This is my heading for some *.c files
C files end in *.c extension
3 - This might be the most painful to do as it's a mess looking at other examples of the implementation. Here's one from vim-pandoc-syntax. At this point, it might just be easier to provide the framework for notes and switch to using markdown for the syntax thereby using someone else's code and not reinvent the wheel : /
If I want something bold, I just the asterisk directly after the last element I'd like to. so whitespace after the asterisk. Maybe this helps to get a better heuristic.