Search code examples
visual-studio-codekeyboard-shortcutsgithub-copilot

How to accept only the next word in GitHub Copilot suggestion?


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?


Solution

  • 💁‍♂️ The default keyboard shortcut is now "Cmd/Ctrl + Right Arrow".

    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"
    }