63 lines
4.8 KiB
Markdown
63 lines
4.8 KiB
Markdown
---
|
|
title: Configuring GitHub Copilot in Visual Studio Code
|
|
intro: 'You can enable, configure, and disable {% data variables.product.prodname_copilot %} in Visual Studio.'
|
|
product: '{% data reusables.gated-features.copilot %}'
|
|
topics:
|
|
- copilot
|
|
versions:
|
|
versions:
|
|
fpt: '*'
|
|
ghec: '*'
|
|
---
|
|
|
|
## Keyboard shortcuts for {% data variables.product.prodname_copilot %}
|
|
|
|
You can use the default keyboard shortcuts in Visual Studio Code when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts in the Keyboard Shortcuts editor 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 |
|
|
|:---|:---:|:---:|
|
|
|Accept an inline suggestion|`Tab`|editor.action.inlineSuggest.commit|
|
|
|Dismiss an inline suggestion|`Esc`|editor.action.inlineSuggest.hide|
|
|
|Show next inline suggestion|On macOS: `Option (⌥) or Alt`+`]`<br> On Windows: `Alt`+`]` |editor.action.inlineSuggest.showNext|
|
|
|Show previous inline suggestion|On macOS: `Option (⌥) or Alt`+`[`<br> On Windows: `Alt`+`[`|editor.action.inlineSuggest.showPrevious|
|
|
|Trigger inline suggestion|On macOS: `Option (⌥)`+`\`<br> On Windows: `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|
|
|
|
|
### Rebinding keyboard shortcuts
|
|
|
|
1. In the **File** menu, navigate to **Preferences** and click **Keyboard Shortcuts**.
|
|

|
|
1. In the **Keyboard Shortcuts** editor, search for the command name of the keyboard shortcut you want to change.
|
|

|
|
1. Next to the command you want to change, click the pencil icon.
|
|

|
|
1. Type the keystrokes you want to use for the command, and press **Enter**.
|
|

|
|
|
|
## Enabling and disabling {% data variables.product.prodname_copilot %}
|
|
|
|
You can enable or disable {% data variables.product.prodname_copilot %} from within Visual Studio Code. The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the Visual Studio Code window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. When enabled, the background color of the icon will match the color of the status bar. When disabled, the background color of the icon will contrast the color of the status bar.
|
|
|
|
1. To enable or disable {% data variables.product.prodname_copilot %}, click the status icon in the bottom panel of the Visual Studio Code window.
|
|

|
|
2. 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 globally**. Alternatively, click the button to disable for the language of the file you are editing.
|
|

|
|
|
|
## Enabling and disabling inline suggestions
|
|
|
|
You can choose to enable or disable inline suggestions in Visual Studio Code.
|
|
|
|
1. In the **File** menu, navigate to **Preferences** and click **Settings**.
|
|

|
|
1. In the left-side panel of the settings tab, click **Extensions** and then select **Copilot**.
|
|
1. Under "Inline Suggest:Enabled", select or deselect the checkbox to enable or disable inline suggestions.
|
|
|
|
## Enabling and disabling {% data variables.product.prodname_copilot %} for specific languages
|
|
|
|
You can specify which languages you want to enable or disable {% data variables.product.prodname_copilot %} for.
|
|
|
|
1. Display the **Copilot** section in the **Extensions** tab of the Visual Studio Code settings page. For more information, see "[Enabling and disabling inline suggestions](#enabling-and-disabling-inline-suggestions)."
|
|
1. Under "Enable or disable Copilot for specified languages", click **Edit in settings.json**.
|
|
1. 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 JSON list.
|