How to Set Up GitHub Copilot in VS Code: Complete 2025 Guide
Step-by-step guide to installing and configuring GitHub Copilot in Visual Studio Code. Learn shortcuts, best practices, and troubleshooting tips for 2025.
Editorial Team
The AI Coding Tools Directory editorial team researches, tests, and reviews AI-powered development tools to help developers find the best solutions for their workflows.
Introduction
GitHub Copilot is the world's most widely-used AI coding assistant, helping millions of developers write code faster. Setting it up in VS Code takes less than 5 minutes, and this guide will walk you through every step.
By the end of this tutorial, you'll have Copilot suggesting code as you type, answering questions in chat, and helping you code 20-30% faster.
Updated for 2025 with the latest features including Copilot Chat, Agent Mode, and the new free tier.
What You'll Need
Before starting, make sure you have:
✅ Visual Studio Code installed (download here) ✅ GitHub account (free - sign up here) ✅ Internet connection (Copilot requires cloud connectivity) ✅ 5 minutes of your time
GitHub Copilot Plans (2025)
Quick overview of what's available:
| Plan | Price | Completions | Chat | Best For | |------|-------|-------------|------|----------| | Free | $0/month | 2,000/month | 50 requests/month | Casual coding, testing Copilot | | Pro | $10/month | ✅ Unlimited | ✅ Unlimited | Individual developers | | Business | $19/user/mo | ✅ Unlimited | ✅ Unlimited | Teams 5-100 devs | | Enterprise | $39/user/mo | ✅ Unlimited | ✅ Unlimited | Large orgs 100+ devs |
Free tier details:
- 2,000 code completions per month (about 1 week of full-time coding)
- 50 chat requests per month (powered by GPT-4.1, Gemini 2.5 Pro)
- No credit card required
- Perfect for getting started!
Students, teachers, and OSS maintainers: Get Copilot Pro FREE with GitHub Student Developer Pack!
Method 1: Quick Setup (Recommended - 2 Minutes)
This is the fastest way to get Copilot running in VS Code.
Step 1: Open VS Code
Launch Visual Studio Code on your computer.
Step 2: Click the Copilot Icon
Look at the bottom-right of your VS Code window. You'll see a Copilot icon (robot head) in the Status Bar.
Click it and select "Set up Copilot".
![Copilot Status Bar Icon Location]
Step 3: Sign In with GitHub
A prompt will appear asking you to sign in:
- Click "Sign in to GitHub"
- VS Code will open your browser
- Authorize the connection between VS Code and GitHub
- Return to VS Code
If you don't have a Copilot subscription:
- You'll automatically be signed up for the Copilot Free plan
- No credit card required
- Start using immediately!
Step 4: Test It Works
Create a new file to test Copilot:
// test.js
// Function to calculate the sum of two numbers
Pause typing after the comment. Copilot should suggest code in gray text (ghost text).
If you see:
function sum(a, b) {
return a + b;
}
✅ Copilot is working! Press Tab to accept the suggestion.
Method 2: Manual Installation (3 Minutes)
If the quick setup didn't work, install the extension manually.
Step 1: Open Extensions View
Keyboard shortcuts:
- Windows/Linux:
Ctrl + Shift + X - macOS:
Cmd + Shift + X
Or click the Extensions icon in the left sidebar (four squares).
Step 2: Search for "GitHub Copilot"
In the Extensions search box, type:
GitHub Copilot
Step 3: Install Extensions
You'll see two extensions:
1. GitHub Copilot (Required)
- Main Copilot extension
- Provides code suggestions
- Click "Install"
2. GitHub Copilot Chat (Recommended)
- Adds chat interface
- Ask questions about code
- Click "Install"
Step 4: Sign In
After installation:
- Click "Sign in to GitHub" in the notification
- Authorize VS Code in your browser
- Return to VS Code
- You're ready!
Configuring Copilot Settings
Once installed, customize Copilot to your preferences.
Access Copilot Settings
- Open Settings:
Ctrl+,(Windows/Linux) orCmd+,(macOS) - Search for "Copilot"
- You'll see dozens of configuration options
Essential Settings to Configure
1. Enable/Disable Copilot for Specific Languages
// settings.json
{
"github.copilot.enable": {
"*": true,
"yaml": false,
"plaintext": false,
"markdown": false
}
}
This enables Copilot for all languages except YAML, plaintext, and Markdown.
2. Inline Suggestions Settings
{
"github.copilot.editor.enableAutoCompletions": true
}
Copilot suggests code automatically as you type.
3. Chat Settings
{
"github.copilot.chat.enabled": true
}
Enables the chat interface.
4. Editor Integration
{
"editor.inlineSuggest.enabled": true
}
Shows Copilot suggestions inline (recommended).
Using GitHub Copilot: The Basics
1. Code Completions (Inline Suggestions)
How it works:
- Start typing code or write a comment
- Copilot suggests completions in gray ghost text
- Press
Tabto accept,Escto reject
Example:
# Function to fetch user data from an API
Copilot suggests:
def fetch_user_data(user_id):
response = requests.get(f"https://api.example.com/users/{user_id}")
return response.json()
Press Tab to accept!
2. Copilot Chat
Open Chat:
- Keyboard shortcut:
Ctrl+I(Windows/Linux) orCmd+I(macOS) - Or: Click the chat icon in the sidebar
Ask questions:
You: How do I read a JSON file in Python?
Copilot: Here's how to read a JSON file in Python:
import json
with open('data.json', 'r') as file:
data = json.load(file)
print(data)
3. Explaining Code
Select code and ask Copilot to explain it:
- Highlight the code
- Right-click → "Copilot" → "Explain This"
- Copilot provides a detailed explanation
Example:
result = [x**2 for x in range(10) if x % 2 == 0]
Copilot explains:
"This is a list comprehension that creates a list of squares of even numbers from 0 to 9. It iterates through numbers 0-9, filters for even numbers (x % 2 == 0), and squares them (x**2)."
4. Generating Tests
Prompt:
// Generate unit tests for the sum function above
Copilot generates:
describe('sum', () => {
it('should add two positive numbers', () => {
expect(sum(2, 3)).toBe(5);
});
it('should add negative numbers', () => {
expect(sum(-2, -3)).toBe(-5);
});
it('should handle zero', () => {
expect(sum(0, 5)).toBe(5);
});
});
5. Code Review and Suggestions
Copilot can review your code:
- Select code block
- Right-click → "Copilot" → "Fix This"
- Copilot suggests improvements
Keyboard Shortcuts (2025)
Master these shortcuts for maximum productivity:
| Action | Windows/Linux | macOS |
|--------|---------------|-------|
| Accept suggestion | Tab | Tab |
| Reject suggestion | Esc | Esc |
| Next suggestion | Alt + ] | Option + ] |
| Previous suggestion | Alt + [ | Option + [ |
| Open Chat | Ctrl + I | Cmd + I |
| Trigger inline suggestion | Alt + \ | Option + \ |
| Open Copilot panel | Ctrl + Shift + P → "Copilot" | Cmd + Shift + P → "Copilot" |
Pro Tips for Better Copilot Suggestions
1. Write Clear Comments
Bad:
# function
Good:
# Function that fetches user profile from PostgreSQL database by user ID,
# includes error handling and returns None if user not found
Detailed comments = better suggestions.
2. Use Descriptive Function Names
Bad:
function process(data) { ... }
Good:
function validateAndSanitizeUserInput(userInput) { ... }
3. Provide Context with Imports
import pandas as pd
import numpy as np
# Copilot now knows you're working with data science
# and will suggest pandas/numpy-specific code
4. Use Examples in Comments
// Function to format phone number
// Example: formatPhoneNumber("1234567890") returns "(123) 456-7890"
5. Iterate Through Suggestions
Don't accept the first suggestion blindly:
- Press
Alt + ](Windows) orOption + ](Mac) to see alternatives - Choose the best one
- Press
Tabto accept
Agent Mode (New in 2025)
Copilot Agent Mode lets Copilot autonomously complete multi-step tasks.
Enable Agent Mode
- Open Command Palette:
Ctrl+Shift+P(Windows) orCmd+Shift+P(Mac) - Type "GitHub Copilot: Enable Agent Mode"
- Select "Enable"
Using Agent Mode
Give high-level instructions:
Create a REST API for a todo app with:
- Express.js backend
- CRUD operations
- MongoDB database
- Error handling
- Input validation
Copilot Agent:
- Creates project structure
- Writes routes, models, controllers
- Adds error handling
- Configures database connection
- Writes tests
All autonomously!
Troubleshooting
Issue: Copilot Icon Not Showing
Solution:
- Check if extensions are installed (Extensions → Search "GitHub Copilot")
- Reload VS Code:
Ctrl+Shift+P→ "Reload Window" - Sign out and sign in again
Issue: No Suggestions Appearing
Check:
- Is Copilot enabled? Look for checkmark on Copilot icon (status bar)
- Are inline suggestions enabled? Settings → Search "inline suggest"
- Language supported? Copilot works with 70+ languages but not all
Solution:
// settings.json
{
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": true
}
}
Issue: "Copilot Free Limit Reached"
Symptoms:
- Message: "You've used your 2,000 completions for this month"
Solutions:
- Wait: Limits reset monthly
- Upgrade: Copilot Pro ($10/mo) has unlimited completions
- Apply for free Pro: Students/teachers/OSS maintainers qualify
Issue: Slow Suggestions
Solutions:
- Check internet: Copilot requires stable connection
- Restart VS Code: Sometimes clears latency
- Reduce extensions: Too many extensions slow VS Code
Issue: Suggestions Not Relevant
Solutions:
- Write better prompts: More context = better suggestions
- Check file type: Ensure VS Code recognizes language (bottom-right corner)
- Reload window:
Ctrl+Shift+P→ "Reload Window"
Best Practices
✅ DO:
- Write clear, descriptive comments
- Review suggestions before accepting
- Use Copilot for boilerplate code
- Ask questions in Copilot Chat
- Experiment with different prompts
❌ DON'T:
- Blindly accept every suggestion without review
- Share API keys or secrets in code (Copilot learns from your code)
- Rely on Copilot for critical security code without review
- Expect perfection (Copilot makes mistakes like humans)
Upgrading to Copilot Pro
If you hit the Free tier limits:
How to Upgrade
- Go to GitHub Copilot Billing
- Click "Upgrade to Pro" ($10/month)
- Enter payment info
- Done! Unlimited completions and chat
Pro Benefits
✅ Unlimited code completions ✅ Unlimited chat requests ✅ Priority access during high traffic ✅ Faster suggestions ✅ Access to latest models (GPT-4.1, Gemini 2.5 Pro, Claude, etc.)
Worth it? If you code full-time, absolutely. $10/month pays for itself in time saved.
Next Steps
Now that Copilot is set up:
- Practice: Code a small project and let Copilot assist
- Learn shortcuts: Master
Tab,Alt+],Ctrl+I - Explore Chat: Ask Copilot to explain complex code
- Try Agent Mode: Let Copilot handle multi-step tasks
- Read docs: Official Copilot documentation
Conclusion
Congratulations! You've successfully set up GitHub Copilot in VS Code. You're now equipped with the world's most popular AI coding assistant.
Remember:
- ✅ Write clear comments for better suggestions
- ✅ Review code before accepting
- ✅ Use Chat for questions and explanations
- ✅ Iterate through suggestions (
Alt/Option + ]) - ✅ Upgrade to Pro when you hit Free tier limits
Happy coding with your new AI pair programmer! 🚀
Sources & Further Reading
This guide was based on official documentation and current 2025 features:
- Set up GitHub Copilot in VS Code - Official Docs
- Get started with GitHub Copilot in VS Code
- GitHub Copilot in VS Code - Complete Integration Guide
- Quickstart for GitHub Copilot - GitHub Docs
- GitHub Copilot Plans & Pricing
- Introducing GitHub Copilot agent mode (preview)
Explore more AI coding tools in our comprehensive directory including Cursor, Codeium, and other Copilot alternatives.
Tools Mentioned in This Article
Frequently Asked Questions
How do I get started with GitHub Copilot in VS Code: Complete 2025 Guide?
Explore More AI Coding Tools
Browse our comprehensive directory of AI-powered development tools, IDEs, and coding assistants.
Browse All Tools