Skip to main content

Configuring GitHub Copilot in Visual Studio

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

GitHub Copilot is available to GitHub customers with a personal account on GitHub.com. Managed user accounts cannot use GitHub Copilot.

GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source projects. If you are not a student, teacher, or maintainer of a popular open source project, you can try GitHub Copilot for free with a one-time 60 day trial. After the free trial, you will need a paid subscription for continued use. 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 suggestionCtrl+Alt+]Tools.Nextsuggestion
Show previous inline suggestionCtrl+Alt+[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. Screenshot of the Keyboard option in the "Options" dialog
  3. Under "Show commands containing:", search for the command you want to rebind. Screenshot of the show commands containing searchbar
  4. Under "Press shortcut keys", type the shorcut 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. Screenshot of the IntelliSense option in the "Options" dialog
  3. Under "General" select Visual Studio and then click Save.

Configuring GitHub Copilot settings on GitHub.com

Once you have an active GitHub Copilot trial or 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

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.

    Settings icon in the user bar

  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. Screenshot of duplication detection option

  4. To confirm your new settings, click Save.

Enabling or disabling telemetry

You can choose whether your code snippets are collected and retained by GitHub and further processed and shared with Microsoft and OpenAI by adjusting your user settings. For more information about data that GitHub Copilot may collect depending on your telemetry settings, see "GitHub Terms for Additional Products and Features" and the GitHub Copilot privacy FAQ.

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

    Settings icon in the user bar

  2. In the left sidebar, click GitHub Copilot.

  3. To allow or prevent GitHub using your telemetry data, select or deselect Allow GitHub to use my code snippets for product improvements. Screenshot of telemetry option

  4. To confirm your new settings, click Save.

Further reading