I would like to be able to accept only the next word of a GitHub Copilot suggestion, instead of the full suggestion. Is there a way to do this?
This is called "partially accepting suggestions". Read the official documentation for more info:
⤠Code completions with GitHub Copilot in VS Code
For custom keybindings, paste something like the following into the keybindings.json
file (which you can find through the omnibox):
{
"key": "shift+ctrl+right",
"command": "editor.action.inlineSuggest.acceptNextWord",
"when": "inlineSuggestionVisible && !editorReadonly"
}
This option exists in VSCode keyboard preferences, but is not enabled by default (though a default keybinding might be coming soon). To enable a shortcut to accept only the next word, in VS Code go to File -> Preferences -> KeyboardShortcuts -> type "acceptNextWord" -> click "+" -> enter your desired keyboard shortcut.
I set acceptNextWord to be alt + RightArrow
to be analogous to Copilot's alt + ]
and alt + [
for next suggestion and previous suggestion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With