Skip to main content

Configuring GitHub Copilot in Visual Studio

You can enable, configure, and disable GitHub Copilot in Visual Studio.

GitHub Copilot can be managed through personal accounts with GitHub Copilot for Individuals or through organization or enterprise accounts with GitHub Copilot for Business.

GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source projects. For more information, see "About billing for GitHub Copilot."

About GitHub Copilot in Visual Studio

If you use Visual Studio, GitHub Copilot can autocomplete code as you type. After installation, you can enable or disable GitHub Copilot, and you can configure advanced settings within Visual Studio or on GitHub.com.

Prerequisites

To configure GitHub Copilot in Visual Studio, you must install the GitHub Copilot plugin. For more information, see "Getting started with GitHub Copilot in Visual Studio."

Keyboard shortcuts for GitHub Copilot

You can use the default keyboard shortcuts in Visual Studio when using GitHub Copilot. Alternatively, you can rebind the shortcuts in the Tools settings for Visual Studio using your preferred keyboard shortcuts for each specific command. You can search for each keyboard shortcut by its command name in the Keyboard Shortcuts editor.

ActionShortcutCommand name
Show next inline suggestionAlt+.Tools.Nextsuggestion
Show previous inline suggestionAlt+,Tools.Previoussuggestion
Trigger inline suggestionCtrl+Alt+\Edit.Copilot.TriggerInlineSuggestion

Rebinding keyboard shortcuts

If you don't want to use the default keyboard shortcuts in Visual Studio when using GitHub Copilot, you can rebind the shortcuts in the Keyboard editor using your preferred keyboard shortcuts for each specific command.

  1. In the Visual Studio toolbar, under Tools, click Options.

    Screenshot of the Options option in the Visual Studio toolbar

  2. In the "Options" dialog, under Environment, click Keyboard.

  3. Under "Show commands containing:", search for the command you want to rebind.

    Screenshot of the show commands containing search bar

  4. Under "Press shortcut keys," type the shortcut you want to assign to the command, then click Assign.

    Screenshot of the keyboard shortcut assignment

Enabling or disabling GitHub Copilot

The GitHub Copilot status icon in the bottom panel of the Visual Studio window indicates whether GitHub Copilot is enabled or disabled. When enabled, the background color of the icon will match the color of the status bar. When disabled, it will have a diagonal line through it.

  1. To enable or disable GitHub Copilot, click the GitHub Copilot icon in the bottom panel of the Visual Studio window.

    Screenshot of editor margin in Visual Studio with the GitHub Copilot icon emphasized

  2. If you are disabling GitHub Copilot, you will be asked whether you want to disable suggestions globally, or for the language of the file you are currently editing.

    • To disable suggestions from GitHub Copilot globally, click Enable Globally.
    • To disable suggestions from GitHub Copilot for the specified language, click Enable for LANGUAGE.

Configuring ReSharper for GitHub Copilot

If you use ReSharper, GitHub Copilot may work best when you configure ReSharper to use GitHub Copilot's native IntelliSense. For more information about ReSharper, see the ReSharper documentation

  1. In the Visual Studio toolbar, under Tools, click Options. Screenshot of the Options option in the Visual Studio toolbar
  2. In the "Options" dialog, under Environment, click IntelliSense and then click General.
  3. Under "General" select Visual Studio and then click Save.

Configuring GitHub Copilot settings on GitHub.com

Once you have an active GitHub Copilot subscription, you can adjust GitHub Copilot settings for your personal account on GitHub in the GitHub Copilot settings. The settings apply anywhere that you use GitHub Copilot. You can configure the suggestions that GitHub Copilot offers and how GitHub uses your telemetry data.

Enabling or disabling duplication detection

Note: If you are a member of an organization on GitHub Enterprise Cloud who has been assigned a GitHub Copilot seat through your organization, you will not be able to configure duplication detection in your personal account settings. Your duplication detection setting will be inherited from your organization or enterprise.

GitHub Copilot includes a filter which detects code suggestions matching public code on GitHub. You can choose to enable or disable the filter. When the filter is enabled, GitHub Copilot checks code suggestions with their surrounding code of about 150 characters against public code on GitHub. If there is a match or near match, the suggestion will not be shown to you.

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

    Screenshot of GitHub's account menu showing options for users to view and edit their profile, content, and settings. The menu item "Settings" is outlined in dark orange.

  2. In the left sidebar, click GitHub Copilot.

  3. Under Suggestions matching public code, select the dropdown menu, then click Allow to allow suggestions matching public code, or Block to block suggestions matching public code.

  4. To confirm your new settings, click Save.

Further reading