Closed etheleon closed 7 years ago
The branch https://github.com/jalvesaq/R-Vim-runtime/tree/rmd_engine highlights other languages if the chunk header matches either {lang
or {r.*engine="lang"
. If the engine of all following chunks is defined with opts_chunk$set(engine = 'lang')
, then the chunks are not correctly highlighted. By default, only R is highlighted. To include other languages, you have to define the value of g:rmd_syn_langs
in your vimrc. Example:
let g:rmd_syn_langs = ["r", "python", "c"]
hi, so does that mean, i need to add the R-Vim-runtime via my vim package manager? I'm using vundle.
edit: Yes it works!
cd ~/vim/bundle
git clone --branch=rmd_engine git@github.com:jalvesaq/R-Vim-runtime.git
in your .vimrc
:
Bundle 'git@github.com:jalvesaq/R-Vim-runtime.git'
then run :PluginInstall
solution taken from: https://github.com/VundleVim/Vundle.vim/issues/592
Is it possible to enable syntax highlighting for code chunks besides R language for R markdown files?
I understand knitr currently supports other languages in the Rmd https://yihui.name/knitr/demo/engines/
the vim-pandoc/vim-pandoc-syntax supports this by via the
:PandocHighlight LANG
commandso for python it'll be
:PandocHighlight python