Shortcut to jump to a chunk in R Markdown?

Viewed 575

Is there a shortcut to jump to a chunk in a R Markdown (on a Mac)? I'm looking for a way to quickly go between one chunk to another.

3 Answers

I'm not completely sure this is possible on Mac, but in RStudio for Windows you can select to show the «document outline» in the IDE. Not really a shortcut perhaps, but it can easily be used to jump to different named chunks in the R Markdown document by clicking it.

enter image description here

By default, I believe the outline is set to only show «Sections» (i.e. ## Header here), so to enable it to show named chunks, go to Tools -> Global options -> R Markdown -> Show in document outline. Then set it to «Sections and Named Chunks»

enter image description here

fn + Command + Up/Down works on the latest RStudio. It also jumps to heading sections.

This preference option exists on the Mac desktop RStudio as well.

Related