VS Code SetupBeginner

How to Set Up GitHub Copilot in VS Code

Install the GitHub Copilot extension, sign in, and turn on inline code suggestions in a few minutes.

7 minBeginner

GitHub Copilot suggests whole lines and blocks of code as you type, drawing on the context of your open files. This guide covers the full setup: installing the extension, signing in with GitHub, and confirming that inline suggestions appear. You will need an active Copilot subscription or access through your organization or the free tier.

What you need

  • VS Code installed
  • A GitHub account
  • A Copilot plan: the free tier, Copilot Pro, or org access
  • About 5 minutes

Step 1: Install the Copilot extension

Open the Extensions view, search for GitHub Copilot, and install the extension published by GitHub. The companion extension GitHub Copilot Chat installs alongside it and gives you the chat sidebar and inline chat.

VS Code - Extensions view
EXTENSIONS [ github copilot ]
----------------------------------------
GitHub Copilot GitHub Install
GitHub Copilot Chat GitHub Install
Both Copilot extensions are published by GitHub.

Step 2: Sign in with GitHub

After installing, a notification asks you to sign in. Click Sign in to GitHub, approve the request in the browser window that opens, and return to VS Code. The account icon at the bottom left will now show your GitHub identity.

No subscription yet
If your account has no Copilot access, VS Code prompts you to set up the free plan or start a trial. The free tier includes a monthly cap on completions and chat messages, which is enough to evaluate the tool.

Step 3: Trigger an inline suggestion

Open any code file and start typing a function or a comment describing what you want. Copilot shows a grey ghost-text suggestion. Press Tab to accept it, Esc to dismiss it, or Alt+] and Alt+[ to cycle through alternatives.

VS Code - editor with suggestion
Explorer
app.py
utils.py
app.py
1# return the average of a list of numbers
2def average(values):
3 return sum(values) / len(values)
Ghost text appears in grey; press Tab to accept.

Step 4: Confirm Copilot is active

Look at the Copilot icon in the status bar at the bottom of the window. When it is enabled and working, it appears solid. If it shows a slash or a warning, click it to see whether you are signed out, offline, or have disabled completions for the current file type.

settings.json
{
  "github.copilot.enable": {
    "*": true,
    "markdown": false,
    "plaintext": false
  }
}
Mute it where it gets noisy
The settings snippet above keeps Copilot on for code but disables it in Markdown and plain text. Adjust the keys to match the languages where suggestions help you and the ones where they get in the way.

Result

Copilot is installed, signed in, and producing inline suggestions. From here you can open the chat sidebar with the chat icon, ask questions about your code, and accept or reject completions as you type.

Watch related tutorials

Tags
#copilot#github#ai#autocomplete