简体   繁体   English

VS Code 上的 R 扩展 - 键盘快捷键不起作用

[英]R extension on VS Code - keyboard shortcut NOT working

I have installed R extension and radian to use R from VS code.我已经安装了 R 扩展和弧度来使用 VS 代码中的 R。 I wanted to run selected line(s) as I do in Rstudio.我想像在 Rstudio 中一样运行选定的行。 Even though it appears to be set among "Keyboard Shortcuts" the shortcut cmd+enter (see pic) doesn't seem to work.即使它似乎设置在“键盘快捷键”中,快捷键cmd+enter (见图)似乎不起作用。 Anyone can think of why?任何人都可以想到为什么? 在此处输入图像描述

I figured it out!我想到了!

  1. First a clarification: the issue was only affecting code in *.rmd |首先澄清一下:这个问题只影响*.rmd | 中的代码。 *.Rmd files, while normal *.R script were doing OK. *.Rmd文件,而普通的*.R脚本运行正常。

  2. As for the *.rmd files, following the instructions here I added this in my settings.json file:至于*.rmd文件,按照此处的说明,我将其添加到我的settings.json文件中:

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

Now my shortcut cmd+enter works like a breeze ✅现在我的快捷键cmd+enter就像轻而易举 ✅

PS: there may be issues also with conflicting keyboard shortcuts. PS:键盘快捷键冲突也可能存在问题。 In fact I deleted some that I have no interest in, but that did not solve it.事实上,我删除了一些我不感兴趣的东西,但这并没有解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM