vim-pandoc / vim-pandoc-syntax

pandoc markdown syntax, to be installed alongside vim-pandoc
MIT License
425 stars 61 forks source link

Code syntax highlighting with `vim-pandoc-syntax` #360

Closed paniash closed 3 years ago

paniash commented 3 years ago

Hi!

Recently I discovered that vim has the functionality for syntax highlighting for language specific code block. This is however, disabled by default and can be enabled by adding the following lines in one's .vimrc:

let g:markdown_fenced_languages = [ 'python', 'vim', 'c' ]

This would allow syntax highlighting for the above 3 languages. However, this functionality works with the default syntax for markdown in vim and not with vim-pandoc-syntax. Is there a way to enable this feature in this syntax plugin?

alerque commented 3 years ago

Yes of course! Set this:

let g:pandoc#syntax#codeblocks#embeds#langs = [ 'python', 'vim', 'c' ]

This and many other settings are documented in the online help:

:help pandoc-syntax-configuration
paniash commented 3 years ago

@alerque Thanks a lot! Didn't realize there was documentation for a syntax plugin. ;-)