VSCode-默认显示并排显示键盘快捷键和用户keybindings.json

问题描述 投票:0回答:1

如果我们在settings.json中设置以下两行-

"workbench.settings.editor": "json",
"workbench.settings.useSplitJSON": true,

我们使用json分割屏幕。因此,当我们按下Ctrl + 逗号时,我们得到-

settings split screen

是否有任何设置可使用Ctrl + K Ctrl + S分割Keyboard Shortcutskeybingings.json并排放置的屏幕。类似于以下内容-

enter image description here

visual-studio-code vscode-settings
1个回答
0
投票

我认为没有自动执行此操作的设置。但是您可以设置一个宏来轻松实现。

使用宏扩展名,在此为multi-command,将其放入您的settings.json:

"multiCommand.commands": [

  {
    "command": "multiCommand.openSplitKeybindings",
    "sequence": [
      "workbench.action.openGlobalKeybindings",
      "workbench.action.newGroupRight",
      "workbench.action.openGlobalKeybindingsFile",
    ]
  }
]

然后在keybindings.json中:

{
  "key": "ctrl+k ctrl+s",                 // remove the default keybinding
  "command": "-workbench.action.openGlobalKeybindings"
},
{ 
  "key": "ctrl+k ctrl+s",
  "command": "extension.multiCommand.execute",
  "args": { "command": "multiCommand.openSplitKeybindings" },
}

我删除了上面的默认键绑定,但是您可以保留它,并根据需要为宏选择一个新的键绑定。

keybindings split demo

gif不能很好地显示它,但是我使用默认的Ctrl + K Ctrl + S键盘绑定来触发宏。您不能只单击Gear Icon / Keyboard Shortcuts(齿轮图标/键盘快捷键)来实现此操作-我认为您不能更改Gear Icon / Keyboard Shortcuts(齿轮图标/键盘快捷键)的默认操作-尤其是因为它在菜单中未显示快捷键绑定。

© www.soinside.com 2019 - 2024. All rights reserved.