gpt4 book ai didi

keyboard-shortcuts - vscode中一个键盘快捷键的多个操作

转载 作者:行者123 更新时间:2023-12-03 11:28:51 25 4
gpt4 key购买 nike

是否可以将多个操作分配给 Visual Studio 代码中的一个键盘快捷键?

例如:
将光标向上移动 x 3 设置为“ctrl + w”

提前致谢。

最佳答案

Commands 这样的扩展是可能的[注:由帖子作者创建]settings.json

"commands.commands": {
"down3": {
"sequence": [
"cursorDown",
"cursorDown",
"cursorDown",
],
},
},
keybindings.json
{
"key": "ctrl+w",
"command": "down3",
},

或仅使用 keybindings.json
{
"key": "ctrl+w",
"command": "commands.run",
"args": [
"cursorDown",
"cursorDown",
"cursorDown"
]
},
支持功能请求 Macro like keybindings #871 .

虽然,对于这个特定的例子,最好使用 built-in命令(以避免任何跳跃):
{
"key": "ctrl+w",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
"value": 3
}
}
https://code.visualstudio.com/api/references/commands

关于keyboard-shortcuts - vscode中一个键盘快捷键的多个操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37009184/

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