GitHub Copilot Setup in VS Code: Complete Step-by-Step Guide
TL;DR Install the GitHub Copilot extension from the VS Code marketplace and sign in with your GitHub account. Free tier gives limited completions; Individual ($10/mo), Business ($19/mo), and Enterprise ($39/mo)…
- Install the GitHub Copilot extension from the VS Code marketplace and sign in with your GitHub account.
- Free tier gives limited completions; Individual ($10/mo), Business ($19/mo), and Enterprise ($39/mo) unlock full access.
- Core shortcuts: Tab to accept, Esc to dismiss, Ctrl + I to open inline chat.
Overview
GitHub Copilot is an AI pair-programming tool that provides real-time code suggestions directly inside VS Code. It generates single-line completions, multi-line blocks, and entire functions based on your current file context, open tabs, and natural-language comments.
This guide covers the full setup process: installing the extension, authenticating your GitHub account, configuring settings, and learning the keyboard shortcuts that make Copilot productive. It applies to all Copilot tiers — Free, Individual, Business, and Enterprise.
- Vendor
- GitHub (Microsoft)
- Platforms
- VS Code, JetBrains, Neovim, Visual Studio
- Pricing
- Free (limited) · Individual $10/mo · Business $19/mo · Enterprise $39/mo
- Extension ID
- GitHub.copilot
Prerequisites
Before installing, confirm you have the following:
- VS Code version 1.90 or later. Run
code --versionin your terminal to check. Update from the VS Code download page if needed. - A GitHub account. Any tier works — the Free plan includes limited completions and chat interactions per month.
- An active Copilot subscription (or willingness to use the Free tier). Organization admins assign Business/Enterprise seats through GitHub settings.
- Internet connection. Copilot sends prompts to GitHub’s servers for inference. There is no offline mode.
No specific OS requirement — Windows, macOS, and Linux are all supported.
Step 1: Install the Copilot Extension
GitHub.copilot.Alternatively, install from the command line:
code --install-extension GitHub.copilot
After installation, you’ll see the Copilot icon in the VS Code status bar (bottom right). A spinning icon means it’s initializing; a steady icon means it’s ready.
GitHub.copilot automatically installs GitHub.copilot-chat. You don’t need to install the Chat extension separately.Step 2: Sign In with GitHub
On first activation, Copilot prompts you to authenticate:
- Click the Copilot icon in the status bar, or open the Command Palette (Ctrl + Shift + P) and run GitHub Copilot: Sign In.
- VS Code opens your default browser to GitHub’s OAuth page.
- Authorize the “GitHub for VS Code” application.
- The browser redirects back to VS Code. The status bar icon updates to confirm authentication.
If you’re behind a corporate proxy or VPN, the browser redirect sometimes fails. In that case, use device code flow: the Command Palette command gives you a code to paste at github.com/login/device.
Step 3: Verify Copilot Is Working
Open or create any code file — a simple Python file works well:
# function to calculate fibonacci sequence
def fibonacci(n):
Place your cursor at the end of the def line and wait 1–2 seconds. Copilot should display a ghost-text suggestion in gray. Press Tab to accept it.
If no suggestion appears:
- Check the status bar icon. A slashed circle means Copilot is disabled for the current language.
- Open the Output panel (Ctrl + Shift + U) and select GitHub Copilot from the dropdown to see logs.
- Confirm your subscription is active at github.com/settings/copilot.
Step 4: Configure Settings
Open VS Code settings (Ctrl + ,) and search for copilot. Key settings to review:
{
"github.copilot.enable": {
"*": true,
"markdown": false,
"plaintext": false
},
"github.copilot.editor.enableAutoCompletions": true,
"editor.inlineSuggest.enabled": true
}
The github.copilot.enable object controls which languages trigger suggestions. Set a language to false to disable Copilot for that file type. The wildcard * sets the default for all languages.
Disable for Specific File Types
If you don’t want completions in config files or documentation:
{
"github.copilot.enable": {
"*": true,
"yaml": false,
"markdown": false,
"json": false
}
}
Workspace-Level Settings
For project-specific configuration, create a .vscode/settings.json file in your repository root. This overrides user-level settings for that workspace only — useful for disabling Copilot in repositories with strict IP policies.
Step 5: Learn the Keyboard Shortcuts
These shortcuts work immediately after installation:
| Action | Windows / Linux | macOS |
|---|---|---|
| Accept suggestion | Tab | Tab |
| Dismiss suggestion | Esc | Esc |
| Next suggestion | Alt + ] | ⌥ + ] |
| Previous suggestion | Alt + [ | ⌥ + [ |
| Open inline chat | Ctrl + I | ⌘ + I |
| Open chat panel | Ctrl + Shift + I | ⌘ + Shift + I |
| Accept word-by-word | Ctrl + → | ⌘ + → |
Word-by-word acceptance is particularly useful when a suggestion is 80% correct — accept the good part, then type your own edit for the rest.
Master Tab, Esc, and Ctrl + I — those three shortcuts cover 90% of daily Copilot interaction.
Step 6: Use Copilot Chat
Copilot Chat provides a conversational interface for code explanation, generation, and debugging. Open it with Ctrl + Shift + I or click the chat icon in the sidebar.
Useful chat commands:
/explain— explain the selected code/fix— suggest a fix for problems in the selection/tests— generate unit tests for the selected code@workspace— include your full workspace as context
Select a block of code before running a command to scope the response. Without a selection, Copilot uses the entire active file as context.
Inline chat (Ctrl + I) is faster for targeted edits. Type a natural-language instruction like “add error handling” or “convert to async” and Copilot generates a diff you can accept or discard.
Tips and Best Practices
- Write descriptive comments before functions. Copilot uses comments as prompts. A comment like
// Parse CSV, skip header, return list of dictsproduces better suggestions than// parse file. - Keep related files open. Copilot reads your open tabs for context. If you’re implementing an interface, keep the interface definition open in another tab.
- Use partial acceptance. When a suggestion is close but not exact, accept word-by-word with Ctrl + → instead of retyping the whole thing.
- Review every suggestion. Copilot generates plausible code, not verified code. Check edge cases, null handling, and security implications before accepting — especially for auth logic, SQL queries, and file operations.
- Disable for sensitive repos. If you work on proprietary code with strict IP requirements, disable Copilot at the workspace level rather than relying on the organization-level content exclusion settings alone.
Troubleshooting Common Issues
No suggestions appearing: Check the Copilot status bar icon. Hover over it to see the current state. Common causes: expired subscription, disabled language, network issues, or file exclusion patterns set by your organization.
Slow suggestions: Copilot requests go through GitHub’s servers. High latency usually means network issues or server load. Check the Output panel for timeout errors. If you’re behind a proxy, configure http.proxy in VS Code settings.
Authentication loop: If VS Code keeps asking you to sign in, clear the stored credentials: open the Command Palette, run GitHub Copilot: Sign Out, then sign in again. On Linux, check that your keyring service (gnome-keyring or kwallet) is running.
FAQ
Is GitHub Copilot free to use in VS Code?
Does Copilot work offline?
How do I disable Copilot for a specific language or project?
"github.copilot.enable": {"yaml": false} to disable a specific language. For project-level control, add the same setting to .vscode/settings.json in your repository root.