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

RMarkdown syntax is too slow #31

Closed jalvesaq closed 6 years ago

jalvesaq commented 6 years ago

Syntax highlight of Rmd files is too slow. In my laptop, Vim needs about 5.2 seconds to start up with a specific Rmd when vim-pandoc-syntax is used, and about 3.5 seconds with the default syntax/markdown.vim. The time was measured by running Vim with the --startuptime argument.

With the syntax/rmd.vim from the new_syn_rmd branch, the times are respectively 3.6 and 1.3 seconds.

The startup time improved because (I guess) the chunks of R code were being highlighted twice: first by either pandoc.vim or markdown.vim and then by rmd.vim. I optimized and simplified the code, but perhaps there are new bugs or important features are missing. So, if you use RMarkdown, please, try the new branch.