Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2

How to Set Up GitHub Copilot in VS Code

Install one extension, sign in with GitHub, and start getting code suggestions in minutes. This guide shows every step in plain words.

In short: install VS Code, add the GitHub Copilot extension, sign in with a GitHub account that has a Copilot plan, and use Tab, chat and agent mode.

Why Copilot in VS Code

WHY

VS Code is free and the most used editor. GitHub Copilot is the most popular assistant for it. Together they give inline suggestions, a chat panel, and an agent that can edit files — a great first setup for any student.

What you need

WHAT
  • VS Code (free, from code.visualstudio.com).
  • A GitHub account (free to make).
  • A Copilot plan: there is a free tier with monthly limits, plus Pro/Business/Enterprise. Confirm current limits on github.com.

The whole setup, top to bottom

1 · Install VS Code free editor 2 · Install the Copilot extension from the Marketplace 3 · Sign in with GitHub free or paid plan 4 · Accept a suggestion Tab on ghost text 5 · Use chat and agent side panel

Step-by-step setup

HOW · INSTALL
  1. Install VS Code and open it.
  2. Open Extensions with Ctrl+Shift+X (Mac: Cmd+Shift+X).
  3. Search "GitHub Copilot" and click Install. (Copilot Chat is included.)
  4. Sign in: a prompt appears — click Sign in to GitHub, approve in the browser, come back to VS Code.
  5. Check the status icon in the bottom bar. If it shows Copilot is active, you are ready.
Settings / config: open Settings (Ctrl+,) and search "Copilot" to turn inline suggestions on/off, enable/disable for some languages, or switch the chat model (if your plan offers choices).
COMPARISON CARDAI Coding

Copilot Free vs Paid (check current limits)

Free: a monthly cap on completions and chat messages; good to try it.
Pro / Business / Enterprise: unlimited completions, more models, agent features, admin controls.
Tip: plans change — confirm the current limits on github.com before you decide.
Ravindra Bagale · ravindrabagale.com/ai-coding

How to use it

  1. Inline: start typing or write a comment like # read a CSV and print the first 5 rows. Grey ghost code appears — press Tab to accept, or Esc to reject.
  2. See more options: press Ctrl+Enter to open a panel of alternative suggestions.
  3. Chat: press Ctrl+Alt+I (Mac: Cmd+Alt+I) or click the chat icon. Ask "explain this file" or "write a test for this function".
  4. Inline chat: press Ctrl+I inside the editor to ask about the selected code right there.
  5. Agent mode: in the chat panel switch to Agent, give a goal, and approve its file edits and commands.

First test (try it now)

  1. Make a file hello.py.
  2. Type the comment: # function that returns the average of a list of numbers and press Enter.
  3. Accept the suggestion with Tab, then run it and check the result.
Rule: read and run every suggestion. Copilot can suggest code that looks right but is wrong.

Safety

  • Do not paste secrets or real customer data into chat.
  • Turn on duplication detection in settings if your org needs it.
  • For private code that must stay offline, use a local model instead (Ollama + Continue).

Quick quiz

1. Which key accepts an inline suggestion?

Tab (Esc rejects it).

2. How do you open Copilot chat?

Ctrl+Alt+I (Mac: Cmd+Alt+I), or click the chat icon.

3. What do you need besides VS Code?

A GitHub account with a Copilot plan (free tier or paid).

4. What does agent mode do?

Edits several files and can run commands, with your approval.

Save tokens and money

SMART AI USE

The free tier has monthly limits — use inline mode for small tasks and save chat for real problems. Ask short, clear questions. See more AI Coding guides.

Save these cards

INTERVIEW CARDAI Coding

How do you add Copilot to VS Code?

Answer: install the GitHub Copilot extension from the Marketplace, sign in with a GitHub account that has a Copilot plan, then accept suggestions with Tab.
Key line: chat is Ctrl/Cmd+Alt+I; agent mode edits files with approval.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Copilot in VS Code in 3 ideas

1 Install: Extensions → GitHub Copilot → Install.
2 Sign in: GitHub account + Copilot plan.
3 Use: Tab = accept, chat panel = ask, agent = multi-file.
Ravindra Bagale · ravindrabagale.com/ai-coding
Next in this course: How to Code in Python Using AI.