37

I find Github Copilot very helpful in some specific situations, but fairly unhelpful in its verbosity in most situations.

By default, it's always on, always suggesting (and frequently getting in my way.) I want it to be less aggressive, disabling the auto-suggestion, but still have it readily available at a keystroke.

What I've tried already:

In a helpful post, I see that Alt\ is the default key for triggering Copilot suggestions. Great, that's half of the solution.

In settings.json, setting the following seems to disable copilot entirely! It is no longer available using the keyboard shortcut.

    "github.copilot.inlineSuggest.enable": false

I wonder if that's a bug, because there's already multiple ways to disable copilot entirely.

Jeff Ward
  • 16,563
  • 6
  • 48
  • 57

4 Answers4

47

In settings.json (under File, Preferences, Settings), I found that setting the more general option:

    "editor.inlineSuggest.enabled": false,

Seems to work as I'd hoped. Copilot suggestions are now only provided on-demand, when I press Alt\, and accepted when I press Tab

I worry that this might disable other types of suggestions I rely on... but language auto-completion still seems to work. I'll update this answer if I find anything I miss.

BTW, changing the keyboard shortcuts:

Under File, Preferences, Keyboard Shortcuts, if you search for inlinesuggest, you see the keystrokes for both triggering inline suggestion and for committing (aka, accepting) inline suggestions. Double-click the row to change the key (but watch out for conflicts.)

VSCode settings for inline suggestions

Jeff Ward
  • 16,563
  • 6
  • 48
  • 57
  • 2
    Did you miss other suggestions in the end, or is this solution still working? I am trying out copilot, but like you I cannot take the continuous dumping of BS in my code – Imre_G Feb 16 '23 at 08:32
  • @Imre_G - I still have it off, haven't missed anything. Sadly, my copilot trial ran out, so I can't comment on the current state of that. – Jeff Ward Feb 16 '23 at 22:26
  • 1
    Well, my company pays for copilot, so I can turn it back on. Sadly, I can't get a nice UX without switching `inlineSuggest` on and off. When it's on, it suggestions show up too often and conflict with intellisense / completion. When it's off, it's hard to trigger and I can't get it to accept (tab doesn't accept copilot suggestions, only intellisense.) I want both, but usually intellisense, and copilot only upon `ALT-\` request – Jeff Ward May 10 '23 at 21:53
  • It doesn't work for me either. Asking ChatGPT is way more bang for you buck IMO. Maybe Copilot X will change things.. – Imre_G May 11 '23 at 09:03
  • 1
    While this solution still works, there is a new propper setting (since April 23) that fixes this: **"github.copilot.editor.enableAutoCompletions": false** – itamargs Jul 02 '23 at 18:54
  • see also this thread: https://github.com/orgs/community/discussions/7323?sort=new – braulio Aug 29 '23 at 09:16
12

For Jetbrains IDE (e.g. Webstorm).

You can uncheck automatically show completions in the IDE's settings (Settings > Languages & Frameworks > GitHub Copilot). enter image description here

and then still TRIGGER completion with a keystroke Alt+\ or any keymap you are comfortable with (Settings > Keymap > "Copilot" in the search bar): enter image description here

BiasInput
  • 654
  • 1
  • 10
  • 28
6

The top rated solution does not seem to work anymore. However the above solution by @BiasInput also works in VSCode.

Open user settings.json and set "github.copilot.editor.enableAutoCompletions": false enter image description here

Then trigger copilot suggestions with the keyboard shorcut you assigned to the command editor.action.inlineSuggest.trigger. enter image description here

Florentin
  • 81
  • 1
  • 2
  • @jeff-ward's solution seems to still work in VS Code for me. Disabled `editor.inlineSuggest.enabled` and I can trigger inline suggestion by keyboard shortcut if desired – Jongho Jeon May 14 '23 at 04:51
1

For anyone who just needs to temporarily disable the inline suggestion that overrides intellisense --> a convenient solution that worked for me, was toggling this setting:

"github.copilot.editor.enableAutoCompletions"

When true, Copilot will work as expected, and give you his inline greyed-out suggestions that can be accepted with tab.

When false, Copilot will still work, but the inline suggestions and autocomplete on tab will be disabled. Thus if you are seeking to temporarily only go for intellisense autocompletion, then this does the trick well.

For toggling, I choose the Settings Cycler VS Code extension.

To configure this, you need to add the toggle behavior with a corresponding unique id to your settings.json file. For example, I have this config:

 "settings.cycle": [
    {
      "id": "copilotInline",
      "overrideWorkspaceSettings": false,
      "values": [
        {
          "github.copilot.editor.enableAutoCompletions": true
        },
        {
          "github.copilot.editor.enableAutoCompletions": false
        }
      ]
    }
  ],

Then to toggle between those two provided values, just add a preferred keybinding to the command by citing the chosen id like this in the keybindings.json file:

  {
    "key": "ctrl+oem_3",
    "command": "settings.cycle.copilotInline"
  }

In my case on ctrl + ö I toggle between those states now!

Samulsen
  • 41
  • 5