jalvesaq / R-Vim-runtime

Vim runtime scripts of file types that include R code
GNU General Public License v2.0
24 stars 28 forks source link

Add support for "=latex" code blocks #47

Closed richyliu closed 2 years ago

richyliu commented 2 years ago

This pull request adds an optional "=" in front of the language name when detecting code blocks. Latex blocks in R markdown requires the code block language to be "=latex" instead of "latex" (so pandoc does not mess with it).

jalvesaq commented 2 years ago

Thanks!

jalvesaq commented 2 years ago

The file syntax/latex.vim is missing. I had to add a symbolic link to syntax/tex.vim to get the code block highlighted:

cd /usr/local/share/nvim/runtime/syntax/
sudo ln -s tex.vim latex.vim
richyliu commented 2 years ago

The file syntax/latex.vim is missing. I had to add a symbolic link to syntax/tex.vim to get the code block highlighted:

cd /usr/local/share/nvim/runtime/syntax/
sudo ln -s tex.vim latex.vim

What I did was add 'latex=tex' to the g:rmd_fenced_languages in my vimrc