Visual Studio VS代码-在打开的文件之间导航- CMD而不是CTRL键

e3bfsja2  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(110)

在MacBook的任何地方,我都使用CMD键进行导航(例如:在浏览器中切换选项卡,或者如果选项卡在Windows中打开,则切换多个选项卡)。我如何在VS代码中实现相同的功能。目前我必须使用Ctrl键在打开的文件之间切换,但我想知道是否可以更改一些配置以使用CMD

rkttyhzu

rkttyhzu1#

我猜你说的是快捷键ctrl+1选择第一个标签,ctrl+2选择第二个标签等?
1.打开keybindings json文件(cmd+shift+p,输入Preferences: Open Keyboard Shortcuts (JSON))。
1.将这些添加到文件的末尾:

{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" },
{ "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" },
{ "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" },
{ "key": "cmd+9", "command": "workbench.action.openEditorAtIndex9" }

字符串
如果你还想修改ctrl+tabctrl+shift+tab来选择上一个/下一个标签,你也可以添加这些(但请记住,它们可能会与mac快捷方式冲突):

{ "key": "cmd+tab",              "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
 "when": "!activeEditorGroupEmpty" },
{ "key": "cmd+shift+tab",        "command": "workbench.action.quickOpenNavigatePreviousInEditorPicker",
 "when": "inEditorsPicker && inQuickOpen" },

相关问题