1

I'm using copilot.

I need to use option + [, to get another suggestions from copilot.

But on my M1 PRO, if I press option + [, ' or " comes out.

Is there any way to modify this?

In order to use other suggestions in copilot, I changed the shortcut corresponding to option + [ in vscode.

option + [ pressing, I get ' or "..

owen
  • 23
  • 2
  • Can you use `Ctrl+[` ? – Philippe Jan 29 '23 at 20:13
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 30 '23 at 05:24
  • Does this answer your question? [How to disable generating special characters when pressing the \`alt+a\`/\`option+a\` keybinding in Mac OS (\`⌥+a\` )?](https://stackoverflow.com/questions/11876485/how-to-disable-generating-special-characters-when-pressing-the-alta-optiona) – Connor McKay Aug 08 '23 at 17:54

2 Answers2

1

So option+] does not work for me, but shift+option+] does, so I have made this keybinding. To open keyboard.json, press cmd+shift+p and search for json keyboard.

{
  {
    "key": "shift+alt+[",
    "command": "editor.action.inlineSuggest.showPrevious",
    "when": "inlineSuggestionVisible && !editorReadonly"
  }
}

So now I can type

function calculateDaysBetweenDates(begin, end) {

trigger suggestion with option+\, and use shift+option+[ or shift+option+] to cycle through suggestions.

rofrol
  • 14,438
  • 7
  • 79
  • 77
0

In the CoPilot docs, see for Visual Studio Code "Keyboard shortcuts for GitHub Copilot". Note the command names.

To customize the key binding in VS Code, open Keyboard Shortcuts (cmd-k cmd-s) and search for editor.action.inlineSuggest.showNext, which is the command name for "Show next inline suggestion". Double-click to change the key binding.

Jonathan Dodds
  • 2,654
  • 1
  • 10
  • 14
  • It seems OP had done this already. The problem is that he can't assign `editor.action.inlineSuggest.showNext` to `Alt+]` – Philippe Jan 29 '23 at 20:01
  • Since Apple keyboards don't have an Alt key, it would be hard to assign. But joking aside, yes I did not read the question as "how do I override the macOS keyboard shortcuts for left double quote and left single quote?" Apple phased out the 'alt' label on keyboards about 5 years ago. The Option key is not an Alt key with a different name. The intended use is different. VS Code shouldn't be mapping alt-] and alt-[ to opt-] and opt-[ because those option key combinations are not usable by applications. (I'll update m y answer.) – Jonathan Dodds Jan 30 '23 at 00:06