Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make this plugin work with R Markdown by default #601

Open
amarz45 opened this issue Sep 25, 2022 · 4 comments
Open

Make this plugin work with R Markdown by default #601

amarz45 opened this issue Sep 25, 2022 · 4 comments

Comments

@amarz45
Copy link
Contributor

amarz45 commented Sep 25, 2022

R Markdown (rmd) is exactly the same as Markdown except with extra features. This plugin should apply not only to the markdown file type, but also to the rmd file type.

@alerque
Copy link
Member

alerque commented Sep 26, 2022

I don't think we can do this by default without creating problems for many people. There are lots or R specific plugins and many of them do not play nice with this one. See for example #263, but I am pretty sure there are others. If we try to snag the rmd filetype we're just going to create problems. It shouldn't be too hard to activate this for the file type yourself if you want to use it, but I can't see making it a default would be viable.

It's possible we could add documentation for how to enable it for more file types and use R Markdown as an example. I'll leave this issue open to track that (contributions welcome).

@amarz45
Copy link
Contributor Author

amarz45 commented Sep 26, 2022

It's possible we could add documentation for how to enable it for more file types and use R Markdown as an example. I'll leave this issue open to track that (contributions welcome).

I am not sure how to activate this plugin for file types other than markdown without switching the file type with the setfiletype command. I think there should be documentation on how to do that.

@alerque
Copy link
Member

alerque commented Sep 27, 2022

au BufRead,BufNewFile *.rmd set ft markdown

If you have other rmd related stuff you want to use and don't want to just pretend they are filetype markdown then you will need to piecemeal import the things you want, for example adding an after/filetype hook to source this plugin code after setting the rmd filetype to get the functions or importing the markdown highlighting into the rmd syntax rules yourself.

@amarz45
Copy link
Contributor Author

amarz45 commented Sep 27, 2022

au BufRead,BufNewFile *.rmd set ft markdown

Can I do autocmd FileType rmd setfiletype markdown or autocmd VimEnter *.rmd setfiletype markdown?

If you have other rmd related stuff you want to use and don't want to just pretend they are filetype markdown then you will need to piecemeal import the things you want, for example adding an after/filetype hook to source this plugin code after setting the rmd filetype to get the functions or importing the markdown highlighting into the rmd syntax rules yourself.

Sorry, I am not sure exactly how to do this. Perhaps there should be an option for this plugin to enable it for other file types?

By the way, if I symlink all markdown.vim files to rmd.vim, I get the same issue as #263. I think this plugin should add an option to enable it for other file types. Then, once #263 is solved, it should be enabled for R Markdown by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants