简体   繁体   English

为什么Shift / Alt键盘组合可用于默认绑定,但不适用于我的自定义绑定? (VS代码)

[英]Why does shift/alt keyboard combination work for default bindings but not my custom ones? (VS Code)

In Fedora Linux/Gnome and VS Code 1.36.1, the original bindings of "key": "shift+alt+right" work fine, but I can't get my custom ones to do anything. 在Fedora Linux / Gnome和VS Code 1.36.1中, "key": "shift+alt+right"的原始绑定可以正常工作,但是我无法让自定义的东西做任何事情。

I am adding to keybindings.json and tried various keys. 我将添加到keybindings.json并尝试了各种密钥。

When I use the Keyboard short cuts and recording keys mode it picks them up fine. 当我使用键盘快捷recording keysrecording keys模式时,它可以很好地拾取它们。

// expand/shrink selection vim style
  {
    "key": "shift+alt+l",
    "command": "editor.action.smartSelect.expand",
    "when": "editorTextFocus"
  },
  {
    "key": "shift+alt+h",
    "command": "editor.action.smartSelect.shrink",
    "when": "editorTextFocus"
  },

There is some kind of intermittent bug, it now works as written in the question. 有某种间歇性错误,它现在可以按照问题中的说明工作。 Here is the full config (working today) in case you want this functionality and it messes you about too! 如果您需要此功能,这里是完整的配置(今天可以使用),它也会使您感到困惑!

// Place your key bindings in this file to overwrite the defaults
[
  // capslock delete
  {
    "key": "capslock",
    "command": "deleteLeft",
    "when": "textInputFocus && !editorReadonly"
  },
  // expand/shrink selection vim style
  {
    "key": "shift+alt+l",
    "command": "editor.action.smartSelect.expand",
    "when": "editorTextFocus"
  },
  {
    "key": "shift+alt+h",
    "command": "editor.action.smartSelect.shrink",
    "when": "editorTextFocus"
  },
  // navigate back forward position
  {
    "key": "alt+left",
    "command": "workbench.action.navigateBack"
  },
  {
    "key": "alt+right",
    "command": "workbench.action.navigateForward"
  },
  // terminal style jump back and forward over words
  {
    "key": "alt+b",
    "command": "cursorWordStartLeft",
    "when": "textInputFocus"
  },
  {
    "key": "alt+f",
    "command": "cursorWordEndRight",
    "when": "textInputFocus"
  },
  // terminal style delete back and forward over words
  {
    "key": "alt+capslock",
    "command": "deleteWordLeft",
    "when": "textInputFocus && !editorReadonly"
  },
  {
    "key": "alt+d",
    "command": "deleteWordRight",
    "when": "textInputFocus && !editorReadonly"
  },
  // Lists with vim style shortcuts
  {
    "key": "alt+j",
    "command": "list.focusDown",
    "when": "listFocus"
  },
  {
    "key": "alt+k",
    "command": "list.focusUp",
    "when": "listFocus"
  },
  // Autosuggest with vim style shortcuts
  {
    "key": "alt+j",
    "command": "selectNextSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
  },
  {
    "key": "alt+k",
    "command": "selectPrevSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
  },
  // Quick open with vim style shortcuts
  {
    "key": "alt+j",
    "command": "workbench.action.quickOpenSelectNext",
    "when": "!editorFocus"
  },
  {
    "key": "alt+k",
    "command": "workbench.action.quickOpenSelectPrevious",
    "when": "!editorFocus"
  },
  // Cursor movement with vim style shortcuts
  {
    "key": "alt+k",
    "command": "cursorUp",
    "when": "textInputFocus && !suggestWidgetVisible"
  },
  {
    "key": "alt+j",
    "command": "cursorDown",
    "when": "textInputFocus && !suggestWidgetVisible"
  },
  {
    "key": "alt+h",
    "command": "cursorLeft",
    "when": "textInputFocus && !suggestWidgetVisible"
  },
  {
    "key": "alt+l",
    "command": "cursorRight",
    "when": "textInputFocus && !suggestWidgetVisible"
  }
]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 格式代码的键绑定-&gt; VS Code中的Shift + Alt + F似乎不起作用 - Keybinding for Format Code -> Shift+Alt+F in VS Code does not seem to work 为什么vsc中的Shift-Alt-F会从我的JavaScript代码中删除所有分号? - Why does Shift-Alt-F in vsc remove all semi-colons from my javascript code? VS code Format Code 命令和快捷键 Shift+Alt+F 不起作用 - VS code Format Code command and shortcut Shift+Alt+F doesn't work VS Code 键盘快捷键 ctrl + 空格不起作用 (Mac Os) - VS Code the keyboard shortcut ctrl + space does not work (Mac Os) 为什么 vs code extension prettier 不起作用? - Why does vs code extension prettier not work? 如何解决 VS Code 自动格式化(alt+shift+F)和 VueJs 默认格式化(npm run lint)规则之间的格式化冲突? - How to solve a formating conflicts between VS Code auto-format(alt+shift+F) and VueJs default formating(npm run lint) rules? 替换 VS Code 中自定义快捷方式的“< -”击键组合 - Replace "< -" keystroke combination for a custom shortcut in VS Code 如何仅在 VS Code 中按下 Shift+Alt+F 时格式化代码? (扩大) - How to format code only when Shift+Alt+F is pressed in VS Code? (extension) 在 VS-Code 中按 ALT+Shift+F 时调整换行符 - Adjust line break when pressing ALT+Shift+F in VS-Code 当连接到远程工作区时,为什么 localhost 在我的 VS Code 的 webviews 中不起作用? - Why does localhost not work inside my VS Code's webviews when connected to remote workspaces?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM