title | shortTitle | intro | redirect_from | topics | versions | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configuring GitHub Copilot in your environment |
Configure in your environment |
You can enable, configure, or disable {% data variables.product.prodname_copilot %} in a supported IDE. |
|
|
|
{% jetbrains %}
If you use a JetBrains IDE, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within your IDE or on {% data variables.product.github %}. This article describes how to configure {% data variables.product.prodname_copilot %} in the IntelliJ IDE, but the user interfaces of other JetBrains IDEs may differ.
To configure {% data variables.product.prodname_copilot %} in a JetBrains IDE, you must install the {% data variables.product.prodname_copilot %} plugin. For more information, see "AUTOTITLE."
You can use the default keyboard shortcuts for inline suggestions in your JetBrains IDE when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts to your preferred keyboard shortcuts for each specific command. For more information on rebinding keyboard shortcuts in your JetBrains IDE, see the JetBrains documentation. For example, you can view the IntelliJ IDEA documentation.
Action | Shortcut |
---|---|
Accept an inline suggestion | Tab |
Dismiss an inline suggestion | Esc |
Show next inline suggestion | Option (⌥) or Alt+] |
Show previous inline suggestion | Option (⌥) or Alt+[ |
Trigger inline suggestion | Option (⌥)+\ |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Option (⌥) or Alt+Return |
Action | Shortcut |
---|---|
Accept an inline suggestion | Tab |
Dismiss an inline suggestion | Esc |
Show next inline suggestion | Alt+] |
Show previous inline suggestion | Alt+[ |
Trigger inline suggestion | Alt+\ |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Alt+Enter |
Action | Shortcut |
---|---|
Accept an inline suggestion | Tab |
Dismiss an inline suggestion | Esc |
Show next inline suggestion | Alt+] |
Show previous inline suggestion | Alt+[ |
Trigger inline suggestion | Alt+\ |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Alt+Enter |
You can enable or disable {% data variables.product.prodname_copilot %} from within your JetBrains IDE. The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the JetBrains window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. When enabled, the icon is highlighted. When disabled, the icon is grayed out.
-
To enable or disable {% data variables.product.prodname_copilot %}, click the status icon in the bottom panel on the right of the JetBrains window.
-
If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing. To disable globally, click Disable Completions. Alternatively, click the language-specific button to disable {% data variables.product.prodname_copilot %} for the specified language.
You can manage advanced settings for {% data variables.product.prodname_copilot %} in your JetBrains IDE, such as how your IDE displays code completions, and which languages you want to enable or disable for {% data variables.product.prodname_copilot %}.
{% data reusables.copilot.jetbrains-settings %} {% data reusables.copilot.jetbrains-languages-and-frameworks %}
- Edit the settings according to your personal preferences.
- To adjust the behavior and appearance of code suggestions, and whether to automatically check for updates, select or deselect the corresponding checkboxes.
- If you have selected to receive automatic updates, you can choose whether to receive stable, but less frequent updates, or nightly updates, which may be less stable. Click the Update channel dropdown and select Stable for stable updates, or Nightly for nightly updates.
You can specify which languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for either in the IDE or by editing your github-copilot.xml
file. If you make changes to language settings in your IDE, you can individually select and deselect the languages you want to activate or deactivate.
If you make changes to the language settings in your github-copilot.xml
file, you can specify individual languages, or you can use a wildcard to activate or deactivate {% data variables.product.prodname_copilot %} for all languages. You can also specify exceptions, which will override the wild card setting for the specified languages. For example, you can deactivate {% data variables.product.prodname_copilot %} for all languages, except for Python and YAML. By default, when you install the {% data variables.product.prodname_copilot %} extension, {% data variables.product.prodname_copilot %} is activated for all languages.
{% data reusables.copilot.jetbrains-settings %} {% data reusables.copilot.jetbrains-languages-and-frameworks %}
- Under "Languages," select or deselect the checkboxes for the languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for.
- Click Apply, and then click OK.
- Restart your JetBrains IDE for the changes to take effect.
To configure language settings in the github-copilot.xml
file, you must edit the languageAllowList
. Every line you add to the languageAllowList
must contain an entry key and a value. The entry key is the name of the language, or (*
) for a wildcard. The value is either true
or false
. If the value is true
, {% data variables.product.prodname_copilot %} is activated for the specified language. If the value is false
, {% data variables.product.prodname_copilot %} is deactivated for the specified language.
The file is located in the following directory:
- macOS:
~/Library/Application Support/JetBrains/<product><version>/options/github-copilot.xml
- Windows:
%APPDATA%\JetBrains\<product><version>\options\github-copilot.xml
- Linux:
~/.config/JetBrains/<product><version>/options/github-copilot.xml
For example, if you are using IntelliJ IDEA 2021.1 on macOS, the file is located at ~/Library/Application Support/JetBrains/IdeaIC2021.1/options/github-copilot.xml
.
The github-copilot.xml
file might not be generated until you make a change to your default language configuration in the IDE's settings. If you cannot locate the file, you should try modifying the default language settings in the IDE. For more information, see "Configuring language settings in the IDE."
Alternatively, you can create the file manually and save it in the location for your operating system listed above. For more information, see "Example language configurations."
-
Open the
github-copilot.xml
file in a text editor. -
Between the
<map>
tags, add the line or lines for the languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for. For example, to deactivate {% data variables.product.prodname_copilot %} for all languages:<entry key="*" value="false" />
-
Save the changes to the
github-copilot.xml
file. -
Restart your JetBrains IDE for the changes to take effect.
The default configuration of the github-copilot.xml
file, which enables {% data variables.product.prodname_copilot %} for all languages is as follows:
<application>
<component name="github-copilot">
<languageAllowList>
<map>
<entry key="*" value="true" />
</map>
</languageAllowList>
</component>
</application>
To deactivate {% data variables.product.prodname_copilot %} for all languages, the wildcard (*
) value is changed to false
:
<application>
<component name="github-copilot">
<languageAllowList>
<map>
<entry key="*" value="false" />
</map>
</languageAllowList>
</component>
</application>
To specify languages individually, add an entry for each language you want to activate or deactivate {% data variables.product.prodname_copilot %} for. Specific language settings will override the wildcard. For example, to activate {% data variables.product.prodname_copilot %} for Python and YAML, and deactivate {% data variables.product.prodname_copilot %} for all other languages, add the following entries:
<application>
<component name="github-copilot">
<languageAllowList>
<map>
<entry key="*" value="false" />
<entry key="Python" value="true" />
<entry key="YAML" value="true" />
</map>
</languageAllowList>
</component>
</application>
You can also add a configuration to make the languageAllowList
readonly in the IDE's settings. This will prevent you from changing the language settings in the IDE. For example:
<application>
<component name="github-copilot">
<option name="languageAllowListReadOnly" value="true" />
<languageAllowList>
<map>
<entry key="*" value="true" />
</map>
</languageAllowList>
</component>
</application>
{% data reusables.copilot.dotcom-settings %}
{% endjetbrains %}
{% visualstudio %}
If you use {% data variables.product.prodname_vs %}, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within {% data variables.product.prodname_vs %} or on {% data variables.product.github %}.
To configure {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, you must install the {% data variables.product.prodname_copilot %} plugin. For more information, see "AUTOTITLE."
You can use the default keyboard shortcuts in {% data variables.product.prodname_vs %} when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts in the Tools settings for {% data variables.product.prodname_vs %} 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.
Action | Shortcut | Command name |
---|---|---|
Show next inline suggestion | Alt+. | Edit.NextSuggestion |
Show previous inline suggestion | Alt+, | Edit.PreviousSuggestion |
If you don't want to use the default keyboard shortcuts in {% data variables.product.prodname_vs %} when using {% data variables.product.prodname_copilot %}, you can rebind the shortcuts in the Keyboard editor using your preferred keyboard shortcuts for each specific command.
-
In the {% data variables.product.prodname_vs %} menu bar, under Tools, click Options.
-
In the "Options" dialog, under Environment, click Keyboard.
-
Under "Show commands containing:", search for the command you want to rebind.
-
Under "Press shortcut keys," type the shortcut you want to assign to the command, then click Assign.
{% data reusables.copilot.enabling-or-disabling-vs %}
If you use ReSharper, {% data variables.product.prodname_copilot %} may work best when you configure ReSharper to use {% data variables.product.prodname_copilot %}'s native IntelliSense. For more information about ReSharper, see the ReSharper documentation
- In the {% data variables.product.prodname_vs %} menu bar, under Extensions, click ReSharper, then click Options.
- In the "Options" dialog, under Environment, click IntelliSense and then click General.
- Under "General" select {% data variables.product.prodname_vs %} and then click Save.
{% data reusables.copilot.dotcom-settings %}
{% endvisualstudio %}
{% vscode %}
If you use {% data variables.product.prodname_vscode %}, you can use {% data variables.product.prodname_copilot %} to:
- Generate code
- Learn from the code {% data variables.product.prodname_copilot_short %} generates
- Help you configure your editor
You can learn more about scenarios and setup in the VS Code documentation.
After you install the {% data variables.product.prodname_copilot %} extension, you can enable or disable it, and you can configure advanced settings within {% data variables.product.prodname_vscode %} or on {% data variables.product.github %}.
To configure {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, you must install the {% data variables.product.prodname_copilot %} extension. For more information, see "AUTOTITLE."
You can use the default keyboard shortcuts for {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_copilot %}. Search keyboard shortcuts by command name in the Keyboard Shortcuts editor.
Alternatively, you can rebind the shortcut for each command in the Keyboard Shortcuts editor. For more information, see the VS Code documentation on key bindings.
Action | Shortcut | Command name |
---|---|---|
Accept an inline suggestion | Tab | editor.action.inlineSuggest.commit |
Dismiss an inline suggestion | Esc | editor.action.inlineSuggest.hide |
Show next inline suggestion | Option (⌥)+] |
editor.action.inlineSuggest.showNext |
Show previous inline suggestion | Option (⌥)+[ |
editor.action.inlineSuggest.showPrevious |
Trigger inline suggestion | Option (⌥)+\ |
editor.action.inlineSuggest.trigger |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Ctrl+Return | github.copilot.generate |
Toggle {% data variables.product.prodname_copilot %} on/off | No default shortcut | github.copilot.toggleCopilot |
Action | Shortcut | Command name |
---|---|---|
Accept an inline suggestion | Tab | editor.action.inlineSuggest.commit |
Dismiss an inline suggestion | Esc | editor.action.inlineSuggest.hide |
Show next inline suggestion | Alt+] | editor.action.inlineSuggest.showNext |
Show previous inline suggestion | Alt+[ | editor.action.inlineSuggest.showPrevious |
Trigger inline suggestion | Alt+\ | editor.action.inlineSuggest.trigger |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Ctrl+Enter | github.copilot.generate |
Toggle {% data variables.product.prodname_copilot %} on/off | No default shortcut | github.copilot.toggleCopilot |
Action | Shortcut | Command name |
---|---|---|
Accept an inline suggestion | Tab | editor.action.inlineSuggest.commit |
Dismiss an inline suggestion | Esc | editor.action.inlineSuggest.hide |
Show next inline suggestion | Alt+] | editor.action.inlineSuggest.showNext |
Show previous inline suggestion | Alt+[ | editor.action.inlineSuggest.showPrevious |
Trigger inline suggestion | Alt+\ | editor.action.inlineSuggest.trigger |
Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane) | Ctrl+Enter | github.copilot.generate |
Toggle {% data variables.product.prodname_copilot %} on/off | No default shortcut | github.copilot.toggleCopilot |
{% data reusables.copilot.enabling-or-disabling-in-vsc %}
You can choose to enable or disable inline suggestions for {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}.
{% data reusables.copilot.vscode-settings %}
- In the left-side panel of the settings tab, click Extensions and then select {% data variables.product.prodname_copilot_short %}.
- Under "Inline Suggest:Enable," select or deselect the checkbox to enable or disable inline suggestions.
You can specify which languages you want to enable or disable {% data variables.product.prodname_copilot %} for.
-
From the {% data variables.product.prodname_vscode %}, click the Extensions tab, then navigate to the Copilot section. For more information, see "Enabling or disabling inline suggestions."
-
Under "Enable or disable {% data variables.product.prodname_copilot_short %} for specified languages," click Edit in settings.json.
-
In the settings.json file, add or remove the languages you want to enable or disable {% data variables.product.prodname_copilot %} for. For example, to enable Python in {% data variables.product.prodname_copilot %}, add
"python": true
to the list, ensuring there is a trailing comma after all but the last list item.{ "editor.inlineSuggest.enabled": true, "github.copilot.enable": { "*": true, "yaml": false, "plaintext": false, "markdown": true, "javascript": true, "python": true } }
{% data variables.product.prodname_vscode %} retains authorization to use {% data variables.product.prodname_copilot %} through a particular {% data variables.product.prodname_dotcom %} account. If you want to prevent your {% data variables.product.prodname_dotcom %} account being used for {% data variables.product.prodname_copilot %} on a device you no longer have access to, you can revoke authorization and then go through the authorization process again. The device you previously used will not have the new authorization.
{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.access_applications %} {% data reusables.user-settings.access_authorized_oauth_apps %}
- Click the ... next to {% data variables.product.prodname_dotcom %} for {% data variables.product.prodname_vscode_shortname %} and click Revoke. {% data reusables.user-settings.access_authorized_github_apps %}
- If the {% data variables.product.prodname_copilot %} extension is listed, click Revoke.
After revoking authorization, {% data variables.product.prodname_vscode %} will be able to continue using {% data variables.product.prodname_copilot %} in a current session for a maximum of 30 minutes. After that time, you will need to reauthorize {% data variables.product.prodname_copilot %} for use in {% data variables.product.prodname_vscode %} again.
After you have revoked authorization, if you want to continue using {% data variables.product.prodname_copilot %}, you will need to complete the reauthorization process.
-
In the bottom left corner of {% data variables.product.prodname_vscode %}, click the Accounts icon, hover over your username, and click Sign out.
-
In the "{% data variables.product.prodname_vscode %}" pop-up, click Sign Out.
-
In the bottom left corner of {% data variables.product.prodname_vscode %}, click the Accounts icon, hover over your username, and click Sign in with {% data variables.product.prodname_dotcom %} to use {% data variables.product.prodname_copilot %}.
-
In your browser, {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click Continue.
-
In the "Open {% data variables.product.prodname_vscode %}?" pop-up, click Open {% data variables.product.prodname_vscode %}.
{% data reusables.copilot.dotcom-settings %}
- {% data variables.product.prodname_copilot %} in VS Code
- {% data variables.product.prodname_copilot %} FAQ
{% endvscode %}
{% vimneovim %}
For guidance on configuring {% data variables.product.prodname_copilot %} in Vim/Neovim, invoke the {% data variables.product.prodname_copilot %} documentation in Vim/Neovim by running the following command:
:help copilot
You can rebind the keyboard shortcuts in Vim/Neovim when using {% data variables.product.prodname_copilot %} to use your preferred keyboard shortcuts for each specific command. For more information, see the Map article in the Neovim documentation.
{% data reusables.copilot.dotcom-settings %}
{% endvimneovim %}
{% xcode %}
{% data reusables.copilot.xcode-beta-note %}
If you use Xcode, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within Xcode or on {% data variables.product.github %}.
To configure {% data variables.product.prodname_copilot %} for Xcode, you must install the {% data variables.product.prodname_copilot %} extension. See "AUTOTITLE."
You can use the default keyboard shortcuts for inline suggestions in Xcode when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts to your preferred keyboard shortcuts for each specific command.
Action | Shortcut |
---|---|
Accept the first line of a suggestion | Tab |
View full suggestion | Hold Option |
Accept full suggestion | Option+Tab |
If you don't want to use the default keyboard shortcuts for {% data variables.product.prodname_copilot %}, you can rebind the shortcuts in the Key Bindings editor and use your preferred keyboard shortcuts.
If you want to use something besides Tab to accept the first line of a suggestion, you need to disable the "Accept suggestions with Tab" option in the advanced settings in the {% data variables.product.prodname_copilot %} for Xcode application. Additionally, we currently only support the Option key for the "View full suggestion" action.
- In the Xcode menu bar, click Settings.
- Click Key Bindings and search for "{% data variables.product.prodname_copilot_short %}" to find the commands you want to rebind.
You can enable or disable the {% data variables.product.prodname_copilot %} extension from within the application.
- Open the {% data variables.product.prodname_copilot %} extension application.
- At the top of the application window, click Advanced.
- In the "Suggestion Settings" section, use the "Request suggestions while typing" toggle to enable or disable the extension.
You can configure the {% data variables.product.prodname_copilot %} extension to automatically check for updates.
- Open the {% data variables.product.prodname_copilot %} extension application.
- Select Automatically check for updates.
After updating the extension, Xcode must be restarted for the changes to take effect.
{% data reusables.copilot.dotcom-settings %}
{% endxcode %}