2021-03-06 21:04:03 -07:00
|
|
|
" Vim syntax file
|
2022-07-15 08:13:16 -07:00
|
|
|
" Language: Markdown-like LSP docstrings
|
|
|
|
" Maintainer: https://github.com/neovim/neovim
|
|
|
|
" URL: http://neovim.io
|
|
|
|
" Remark: Uses markdown syntax file
|
2021-03-06 21:04:03 -07:00
|
|
|
|
2022-07-15 08:13:16 -07:00
|
|
|
" Source the default Nvim markdown syntax, not other random ones.
|
2021-05-26 14:47:53 -07:00
|
|
|
execute 'source' expand('<sfile>:p:h') .. '/markdown.vim'
|
2021-03-06 21:04:03 -07:00
|
|
|
|
2021-06-14 15:41:07 -07:00
|
|
|
syn cluster mkdNonListItem add=mkdEscape,mkdNbsp
|
2021-03-06 21:04:03 -07:00
|
|
|
|
2022-07-15 08:13:16 -07:00
|
|
|
" Don't highlight invalid markdown syntax in LSP docstrings.
|
|
|
|
syn clear markdownError
|
|
|
|
|
2021-06-25 08:01:06 -07:00
|
|
|
syn clear markdownEscape
|
|
|
|
syntax region markdownEscape matchgroup=markdownEscape start=/\\\ze[\\\x60*{}\[\]()#+\-,.!_>~|"$%&'\/:;<=?@^ ]/ end=/./ containedin=ALL keepend oneline concealends
|
|
|
|
|
2022-07-15 08:13:16 -07:00
|
|
|
" Conceal backticks (which delimit code fragments).
|
|
|
|
" We ignore g:markdown_syntax_conceal here.
|
|
|
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart concealends
|
|
|
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart concealends
|
|
|
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*````*.*$" end="^\s*````*\ze\s*$" keepend concealends
|
|
|
|
|
|
|
|
" Highlight code fragments.
|
|
|
|
hi def link markdownCode Special
|
|
|
|
|
|
|
|
" Conceal HTML entities.
|
2021-03-06 21:04:03 -07:00
|
|
|
syntax match mkdNbsp / / conceal cchar=
|
2021-06-25 08:01:06 -07:00
|
|
|
syntax match mkdLt /</ conceal cchar=<
|
|
|
|
syntax match mkdGt />/ conceal cchar=>
|
|
|
|
syntax match mkdAmp /&/ conceal cchar=&
|
|
|
|
syntax match mkdQuot /"/ conceal cchar="
|
2021-03-06 21:04:03 -07:00
|
|
|
|
2022-07-15 08:13:16 -07:00
|
|
|
hi def link mkdEscape Special
|