Turn off highlighting a specific template in vim

In vim, I am editing the filetype file "markdown", but which contains mathematical latex expressions such as $ x_i $. Highlighting Vim's syntax for markdowns considers the * _ * (letter-underscore-letter) pattern to be a mistake and emphasizes underlining in such bright colors. I would like to disable this by adding a line to my .vimrc:

autocmd BufEnter *.Rmd "Dear vim, please don't highlight the pattern *_*"

What is the appropriate command for this? Is it even possible to do this in .vimrc without editing the syntax file?

Note. I want to keep markup syntax highlighting as a whole, disable only this function.

+4
source share
2 answers

Markdown. - :

:syn clear markdownError

, _ char. :

:hi link markdownError Normal

, $x_i$, ; , , :

:syn match markdownIgnore "\$x_i\$"

( .) ~/.vim/after/syntax/markdown.vim script.

+6

_ , . , URL- .

, syntax/markdown.vim

" Original error pattern
syn match markdownError "\w\@<=_\w\@="

_ ~/.vim/after/syntax/markdown.vim.

" New error pattern without the underscore
syn match markdownError "\w\@<=\w\@="
+6

All Articles