AndrewRadev/splitjoin.vim

Support for rmardown (rmd) and quarto (qmd)

PMassicotte opened this issue · 2 comments

First, thank you for this plugin, it is very useful.

While it works fine with R scripts, would it be possible to make it work for rmarkdown and quarto documents?

I have checked help,

:h splitjoin-r

but could not find a way to configure it with qmd and rmd files.

Cheers,
Phil

Thank you for the kind words :).

Both of these seem to be R embedded in markdown. If you'd like to just get them to work the same as R, you could create an ftplugin for the document filetype, say, ftplugin/rmd.vim that executes

runtime! ftplugin/r/splitjoin.vim

The ftplugin file for a certain filetype is evaluated when that filetype is triggered. The command runtime! finds the path in the runtimepath and evaluates it. Splitjoin's R support is in ftplugin/r/splitjoin.vim

I could set this up in the plugin itself, but you should be able to get it working like I described as a test to try it out.

Works just perfectly! Thank you very much!