I'm using VS Code to edit a file with lots of tabs.
Github Copilot by default binds tab key to the "commit inline suggestion" action.
I want to disable that default keybinding so I don't need to first dismiss the suggestion through escape before being able to type a literal tab.
The following in my keybindings.json
used to work, but it no longer does, what's the new syntax?
{
"key": "tab",
"command": "-editor.action.inlineSuggestmit",
"when": "inlineSuggestionVisible"
},
I'm using VS Code to edit a file with lots of tabs.
Github Copilot by default binds tab key to the "commit inline suggestion" action.
I want to disable that default keybinding so I don't need to first dismiss the suggestion through escape before being able to type a literal tab.
The following in my keybindings.json
used to work, but it no longer does, what's the new syntax?
{
"key": "tab",
"command": "-editor.action.inlineSuggestmit",
"when": "inlineSuggestionVisible"
},
Share
Improve this question
edited Mar 26 at 10:33
Cornelius Roemer
asked Mar 21 at 13:25
Cornelius RoemerCornelius Roemer
8,5843 gold badges56 silver badges104 bronze badges
1 Answer
Reset to default 0To debug, I looked at the "Keyboard Shortcuts" menu and checked what actions were present there for "Tab". It turns out that VS Code seems to have added a few default keybindings that I needed to disable to get my tab key to again be left alone:
Once one identifies a "System" keybinding, one can copy it (CMD+C) and then paste it into the "keybindings.json" file and add a -
before the "command" string:
Adding these lines worked for me:
{
"key": "tab",
"command": "-editor.action.inlineSuggestmit",
"when": "inlineEditIsVisible && tabShouldAcceptInlineEdit && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineEditIsVisible && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineEditIsVisible && inlineSuggestionVisible && tabShouldAcceptInlineEdit && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible"
},
{
"key": "tab",
"command": "-editor.action.inlineSuggestmit",
"when": "inInlineEditsPreviewEditor"
},