vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Is there a way to sync scroll rmd file and the compiled html file?

Open jiangtianli91 opened this issue 11 months ago • 1 comments

For regular markdown file, vscode can sync it with the compiled html so that one can scroll them synchronously. I couldn't find a way to achieve that for rmarkdown in vscode. Is there a way to do so?

I have checked the setting for R and markdown in vscode, but cannot find a way to achieve it.

jiangtianli91 avatar Mar 18 '24 04:03 jiangtianli91

If you don't need codes to run, but just to view the text and math in HTML while you are writing, then in the settings.json, you could associate Rmd with markdown

    "files.associations": {
      "*.Rmd": "markdown",
      "*.rmd": "markdown",
    },

Then keyboard settings like below, will generate a plain version of HTML that could scroll with Rmd synchronously.

  {
    "key": "shift+alt+m",
    "command": "markdown.showPreviewToSide",
    "when": "editorTextFocus && editorLangId == 'rmd'"
  }

Fred-Wu avatar Jun 18 '24 04:06 Fred-Wu