VSCode - 默认并排显示键盘快捷键和用户 keybindings.json [英] VSCode - Show Keyboard Shortcuts and user keybindings.json side-by-side by default

查看:202
本文介绍了VSCode - 默认并排显示键盘快捷键和用户 keybindings.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我们使用 json 获得分屏.所以当我们按下 Ctrl+Comma 我们得到 -

是否有任何设置可以使用 Ctrl+Keyboard Shortcuts 和 keybingings.json 并排的位置获得分屏>K Ctrl+S.类似于以下内容 -

解决方案

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

使用宏扩展,这里

gif 不能很好地显示,但我使用了默认的 Ctrl+K Ctrl+S键绑定来触发宏,它比 gif 中出现的更快更流畅.

你不能只点击齿轮图标/键盘快捷键来获得这种行为——我认为你不能改变齿轮图标/键盘快捷键的默认操作——特别是因为它没有在菜单中显示快捷键绑定.但是你说你正在寻找键绑定解决方案.

If we set the following two lines in settings.json -

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

We get split screen with json. So when we press Ctrl+Comma we get -

Is there any settings to get split screen where Keyboard Shortcuts and keybingings.json resides side-by-side using Ctrl+K Ctrl+S. something like the following -

解决方案

I don't think there is a setting to do this automatically. But you could set up a macro to do it pretty easily.

Using a macro extension, here multi-command, put this into your settings.json:

"multiCommand.commands": [

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

and then in 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" },
}

I removed the default keybinding above but you could just keep it and choose a new keybinding for the macro if you wish.

The gif doesn't show it well but I used the default Ctrl+K Ctrl+S keybinding to trigger the macro and it is faster and smoother than it appears in the gif.

You cannot just click on the Gear Icon/Keyboard Shortcuts to get this behaviour - I don't think you can change the Gear Icon/Keyboard Shortcuts default action - especially since it doesn't present a shortcut binding in the menu there. But you stated you were looking for keybinding solution.

这篇关于VSCode - 默认并排显示键盘快捷键和用户 keybindings.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆