You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When inserting an R code block in a .rmd notebook using the keyboard shortcut cmd + option + i, the behavior is not 'smart' like it is in Rstudio - it 'nests' blocks rather than 'splitting' them.
```{r}
# some code here
# put cursor here
# more code here
```
For example, if you place your cursor at the location noted in the block above, then press cmd + option + i, you get:
```{r}
# some code here
```{r}
```
# more code here
```
This 'nested' syntax is undefined. Instead, it should produce:
```{r}
# some code here
```
```{r}
# more code here
```
I think this can be accomplished by setting a 'context key' in the extension whenever the cursor is in a block, then creating two keybindings, one for inside a block, another for outside a block.
@njspix You should have shared your keybindings.json, as the shortcut you described is not included out of the box. I guess you’re using the shortcuts from the wiki?
While I don't think it's impossible to implement this functionality, in my opinion, I would recommend using the Quarto extension.
The traditional Rmd syntax is hacky, and I think Quarto is more robust and has more room to add such functionality.
Activity
ThomasSoeiro commentedon Sep 23, 2026
@njspix You should have shared your
keybindings.json, as the shortcut you described is not included out of the box. I guess you’re using the shortcuts from the wiki?The described behavior seems expected.
@eitsupi @Fred-Wu @grantmcdermott Perhaps it can be closed?
eitsupi commentedon Sep 23, 2026
While I don't think it's impossible to implement this functionality, in my opinion, I would recommend using the Quarto extension.
The traditional Rmd syntax is hacky, and I think Quarto is more robust and has more room to add such functionality.