gpt4 book ai didi

r - 使用 VSCode 在 Quarto Docs 中为 R block 添加键盘快捷键

转载 作者:行者123 更新时间:2023-12-05 03:22:13 27 4
gpt4 key购买 nike

是否可以使用 vscode 在 quarto 文档中为 R block 添加键盘快捷键?

我正在尝试使用管道运算符 %>% (ctrl+shift+m​​) 等快捷方式。我想我应该通过在 keybinds.json 文件中包含类似下面的代码来做到这一点,但它对我不起作用:

    {
"key": "ctrl+shift+m",
"command": "type",
"when": "editorLangId == 'r' || editorTextFocus && editorLangId == 'qmd'",
"args": { "text": " %>% " }
},

最佳答案

我假设 keybinds.json 是您帖子中的错字(正确的文件名是 keybindings.json)。

假设我没理解错,这是我的 keybindings.json

// Place your key bindings in this file to override the defaults
[{
"key": "ctrl+shift+m",
"command": "type",
"args": { "text": "%>%" },
"when": "editorTextFocus"
}
]

然后 Ctrl+Shift+m​​ 将 "%>%"放在光标的当前位置。

关于r - 使用 VSCode 在 Quarto Docs 中为 R block 添加键盘快捷键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72779973/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com