About GitHub Copilot in JetBrains IDEs
If you use a JetBrains IDE, GitHub Copilot can autocomplete code as you type. After installation, you can enable or disable GitHub Copilot, and you can configure advanced settings within your IDE or on GitHub.com. This article describes how to configure GitHub Copilot in the IntelliJ IDE, but the user interfaces of other JetBrains IDEs may differ.
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.
-
In the upper-right corner of any page, click your profile photo, then click Settings.
-
In the left sidebar, click GitHub Copilot.
-
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.
-
To confirm your new settings, click Save.
Further reading
Prerequisites
To configure GitHub Copilot in a JetBrains IDE, you must install the GitHub Copilot plugin. For more information, see "Getting started with GitHub Copilot in a JetBrains IDE."
Keyboard shortcuts for GitHub Copilot
You can use the default keyboard shortcuts for inline suggestions in your JetBrains IDE when using GitHub 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 GitHub 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 GitHub 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 GitHub Copilot (additional suggestions in separate pane) | Alt+Enter |
Enabling or disabling GitHub Copilot
You can enable or disable GitHub Copilot from within your JetBrains IDE. The GitHub Copilot status icon in the bottom panel of the JetBrains window indicates whether GitHub Copilot is enabled or disabled. When enabled, the icon is highlighted. When disabled, the icon is grayed out.
-
To enable or disable GitHub Copilot, click the status icon in the bottom panel on the right of the JetBrains window.
-
If you are disabling GitHub 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 GitHub Copilot for the specified language.
Configuring advanced settings for GitHub Copilot
You can manage advanced settings for GitHub Copilot in your JetBrains IDE, such as how your IDE displays code completions, and which languages you want to enable or disable for GitHub Copilot.
- In your JetBrains IDE, click the File menu, then click Settings.
- Under Languages & Frameworks, click GitHub Copilot.
- 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.
- Under "Disabled languages," use the checkboxes to select or deselect the languages you want to disable GitHub Copilot for.
Configuring proxy settings for GitHub Copilot
You can configure GitHub Copilot to connect through an HTTP proxy server in a JetBrains IDE. GitHub Copilot supports basic HTTP proxy setups, with or without basic authentication.
- In your JetBrains IDE, click the File menu, then click Settings.
- Under Appearance & Behavior, click System Settings and then click HTTP Proxy.
- Select Manual proxy configuration, and then select HTTP.
- In the "Host name" field, enter the hostname of your proxy server, and in the "Port number" field, enter the port number of your proxy server.
- Optionally, in the left sidebar, click Tools and then click Server Certificates. Then select or deselect Accept non-trusted certificates automatically, depending on whether you want to accept non-trusted certificates automatically.
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.
-
In the upper-right corner of any page, click your profile photo, then click Settings.
-
In the left sidebar, click GitHub Copilot.
-
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.
-
To confirm your new settings, click Save.