Skip to main content

Configuring GitHub Copilot in your environment

You can enable, configure, or disable GitHub Copilot in a supported IDE.

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.

Prerequisites

To configure GitHub Copilot in Visual Studio, you must install the GitHub Copilot plugin. For more information, see Getting code suggestions in your IDE with GitHub Copilot.

Using or rebinding 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.

Using default keyboard shortcuts

ActionShortcutCommand name
Show next inline suggestionAlt+.Edit.NextSuggestion
Show previous inline suggestionAlt+,Edit.PreviousSuggestion

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 menu bar, under Tools, click Options.

    Screenshot of the Visual Studio menu bar. The "Tools" menu is expanded, and the "Options" item is highlighted with an orange outline.

  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. The string "tools.next" is entered in the search field.

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

    Screenshot of the fields for entering a new 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 menu bar, under Extensions, click ReSharper, then click Options.
  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

If you are using a GitHub Copilot Pro subscription, you can choose to allow or block code completion suggestions that match publicly available code. You can also allow or block the collection and retention of the prompts you enter and Copilot's suggestions. You configure this in your personal settings on GitHub.com. See Managing Copilot policies as an individual subscriber.

Further reading

Authenticating to an account on GHE.com

If you're using a Copilot subscription for a managed user account account on GHE.com, you'll need to update some settings before you sign in. See Using GitHub Copilot with an account on GHE.com.