Shortcut for commenting in Rmarkdown?

一笑奈何 提交于 2019-12-25 02:58:31

问题


Simple question: does anyone know of a shortcut key for commenting in Rmd?

In Knitr this can be done using CTRL + C, which produces in both writing and coding environment a comment line. This does not work in Rmd unfortunately.

At the moment I have to type out:

<!-- Comments --> 

I am using R-studio.


回答1:


Add a snippet under the "markdown" section:

(I made mine hcm) then type:

hcmShiftTab and it'll expand to whatever you want (mine was <!-- -->)

You can make the snippet text shorter as well.

I agree with Ben that you could go to RStudio support and ask for a kbd shortcut for this.



来源:https://stackoverflow.com/questions/33260971/shortcut-for-commenting-in-rmarkdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!