VSCode Remap键盘快捷键 [英] VSCode Remap keyboard shortcut

查看:107
本文介绍了VSCode Remap键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了一段时间,以重新映射 Ctrl + Tab Ctrl + Shift + Tab 键可线性切换编辑器标签. (就像在Chrome中一样)

I have been trying for awhile now to remap the Ctrl+Tab and Ctrl+Shift+Tab keys to switch editor tabs linearly. (Like they would in Chrome)

我了解到,默认情况下, Ctrl + PgUp Ctrl + PgDown 键具有功能我渴望.但是,无论是通过图形化的键盘快捷方式"页面还是keybindings.json文件,我都无法获取按键来执行我希望它们执行的操作.

I have learned that by default, the Ctrl+PgUp and Ctrl+PgDown keys have the functionality I desire. However, whether it be through the graphical Keyboard Shortcut page or the keybindings.json file, I cannot get the keys to do what I want them to.

keybindings.json的相关部分:

{
  "key": "ctrl+pagedown",
  "command": "-selectNextPageSuggestion"
},
{
  "key": "ctrl+pageup",
  "command": "-selectPrevPageSuggestion"
},
{
  "key": "ctrl+tab",
  "command": "-workbench.action.openNextRecentlyUsedEditorInGroup"
},
{
  "key": "ctrl+shift+tab",
  "command": "-workbench.action.openPreviousRecentlyUsedEditorInGroup"
},
{
  "key": "ctrl+tab",
  "command": "selectNextPageSuggestion"
},
{
  "key": "ctrl+shift+tab",
  "command": "selectPrevPageSuggestion"
}

从理论上讲,我认为这应该可行,但是只能禁用 Ctrl + Tab Ctrl + Shift + Tab 键完整,并且不给它们 Ctrl + PgUp Ctrl + PgDown 行为.

Theoretically, I believe that this should work, but it only disables the Ctrl+Tab and Ctrl+Shift+Tab keys entirely, and doesn't give them the Ctrl+PgUp and Ctrl+PgDown behavior that I am after.

感谢您的帮助.

推荐答案

您的代码似乎过于复杂.我只是将以下内容放入我的keybindings.json文件中,它运行良好:

Your code seems overly complicated. I just put the following into my keybindings.json file and it is working perfectly:

{ "key": "ctrl+tab",         "command": "workbench.action.nextEditor" },
{ "key": "ctrl+shift+tab",   "command": "workbench.action.previousEditor" },

它不会禁用 Ctrl + PgUp Ctrl + PgDown ,但是会添加新功能欲望.

It doesn't disable Ctrl+PgUp and Ctrl+PgDown but does add the new functionality you desire.

这篇关于VSCode Remap键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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