11

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?

Jacob Stern
  • 3,758
  • 3
  • 32
  • 54

2 Answers2

12

The default keyboard shortcut is now "Cmd/Ctrl + Right Arrow".

Amiratak88
  • 1,204
  • 12
  • 18
  • Note: The vim Extensions `extension.vim_cmd+right` shortcut has higher precedence seemingly, so I had to remove that shortcut for the partial accept to work. – Simon Boehm Aug 02 '23 at 15:34
5

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.

Jacob Stern
  • 3,758
  • 3
  • 32
  • 54