Beginner12 min1 prerequisite

Install and configure GitHub Copilot in VS Code, JetBrains IDEs, and other supported editors.

Setting Up GitHub Copilot

This lesson walks through installing GitHub Copilot in popular editors and configuring it for optimal use.

Prerequisites

Before installing, you need:

  1. GitHub Account: Sign up at github.com
  2. Copilot Subscription: Individual, Business, or Enterprise
  3. Supported Editor: VS Code, JetBrains, Neovim, etc.

Getting a Subscription

  1. Go to github.com/features/copilot
  2. Click "Start my free trial" (30 days free)
  3. Choose Individual ($10/mo) or verify through organization

Students and open source maintainers may qualify for free access.

VS Code Installation

Step 1: Install Extension

  1. Open VS Code
  2. Go to Extensions (Cmd/Ctrl+Shift+X)
  3. Search "GitHub Copilot"
  4. Install both:
    • GitHub Copilot: Code completions
    • GitHub Copilot Chat: Conversational assistance

Or via command line:

Terminal
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat

Step 2: Sign In

  1. Click the Copilot icon in the status bar
  2. Click "Sign in to GitHub"
  3. Authorize in browser
  4. Return to VS Code

You should see the Copilot icon become active (no warning symbol).

Step 3: Verify Installation

Create a test file:

Terminal
// test.js
function greet(name) {
  // Start typing and see suggestions
}

If suggestions appear as gray text, Copilot is working.

JetBrains IDE Installation

Works with IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs.

Step 1: Install Plugin

  1. Open Settings/Preferences (Cmd/Ctrl+,)
  2. Go to Plugins
  3. Search "GitHub Copilot"
  4. Click Install
  5. Restart the IDE

Step 2: Sign In

  1. Open Settings/Preferences
  2. Go to Tools > GitHub Copilot
  3. Click Login to GitHub
  4. Complete browser authorization

Step 3: Configure

In Settings > Tools > GitHub Copilot:

  • Show completions automatically: Enabled (recommended)
  • Enable GitHub Copilot Chat: Check to enable
  • Proxy settings: Configure if behind corporate firewall

Neovim Installation

Using a Plugin Manager

With lazy.nvim:

Terminal
{
  "zbirenbaum/copilot.lua",
  cmd = "Copilot",
  event = "InsertEnter",
  config = function()
    require("copilot").setup({
      suggestion = {
        enabled = true,
        auto_trigger = true,
        keymap = {
          accept = "<Tab>",
          accept_word = "<C-Right>",
          accept_line = "<C-Down>",
          next = "<M-]>",
          prev = "<M-[>",
          dismiss = "<C-]>",
        },
      },
    })
  end,
}

With packer.nvim:

Terminal
use {
  "zbirenbaum/copilot.lua",
  config = function()
    require("copilot").setup()
  end,
}

Authentication

Run in Neovim:

Terminal
:Copilot auth

Follow the browser prompt to authenticate.

Other Editors

Visual Studio

  1. Extensions > Manage Extensions
  2. Search "GitHub Copilot"
  3. Download and install
  4. Restart Visual Studio
  5. Sign in via Tools > Options > GitHub Copilot

Xcode

Copilot for Xcode is available through third-party tools like:

  • CopilotForXcode: Community extension

Vim

Use the official plugin:

Terminal
Plug 'github/copilot.vim'

Run :Copilot setup to authenticate.

Configuration Options

VS Code Settings

Open settings (Cmd/Ctrl+,) and search "Copilot":

Terminal
{
  // Enable/disable Copilot
  "github.copilot.enable": {
    "*": true,
    "markdown": false,
    "plaintext": false
  },

  // Inline suggestions
  "github.copilot.inlineSuggest.enable": true,

  // Editor behavior
  "editor.inlineSuggest.enabled": true,

  // Chat settings
  "github.copilot.chat.localeOverride": "en"
}

Language-Specific Settings

Disable for specific languages:

Terminal
{
  "github.copilot.enable": {
    "*": true,
    "yaml": false,
    "markdown": false,
    "json": false
  }
}

Keyboard Shortcuts

Default VS Code shortcuts:

ActionmacOSWindows/Linux
Accept suggestionTabTab
Dismiss suggestionEscEsc
Next suggestionAlt+]Alt+]
Previous suggestionAlt+[Alt+[
Open completions panelCtrl+EnterCtrl+Enter
Open Copilot ChatCmd+Shift+ICtrl+Shift+I

Customize in Keyboard Shortcuts:

Terminal
{
  "key": "ctrl+g",
  "command": "github.copilot.generate",
  "when": "editorFocus"
}

Organization Settings

For Copilot Business/Enterprise:

Admin Configuration

In GitHub Organization Settings:

  1. Go to Settings > Copilot
  2. Configure policies:
    • Who can use Copilot
    • Suggestion matching (public code)
    • Data retention
    • Telemetry

Content Exclusion

Exclude files from Copilot context:

Terminal
# .github/copilot-content-exclusion.yaml
- "*.env"
- "**/.env.*"
- "secrets/**"
- "config/production/**"

Or in repository settings:

  1. Settings > Code security and analysis
  2. Configure content exclusion patterns

Proxy Configuration

For corporate networks:

VS Code

Terminal
{
  "http.proxy": "http://proxy.company.com:8080",
  "http.proxyStrictSSL": false
}

JetBrains

Settings > Appearance & Behavior > System Settings > HTTP Proxy

Environment Variables

Terminal
export HTTP_PROXY="http://proxy.company.com:8080"
export HTTPS_PROXY="http://proxy.company.com:8080"

Troubleshooting

"Copilot is not available"

  1. Check subscription status at github.com/settings/copilot
  2. Verify you're signed in with the correct account
  3. Check for extension updates

Suggestions Not Appearing

  1. Ensure the file type is not disabled
  2. Check status bar for Copilot icon state
  3. Try restarting the extension:
    Terminal
    Cmd/Ctrl+Shift+P > Reload Window
    

Rate Limiting

If you see "rate limited":

  • Wait a few minutes
  • Check network connectivity
  • Verify proxy settings

Authentication Issues

Reset authentication:

VS Code:

Terminal
Cmd/Ctrl+Shift+P > GitHub Copilot: Sign Out

Then sign in again.

JetBrains: Settings > Tools > GitHub Copilot > Reset Authentication

Verifying Setup

Test all features:

1. Test Completions

Terminal
# Create a Python file and type:
def calculate_fibonacci(n):
    # Copilot should suggest implementation

2. Test Chat

Press Cmd/Ctrl+Shift+I to open chat:

Terminal
What's the best way to sort a list in Python?

3. Test Inline Chat

Select code and press Cmd+I:

Terminal
/explain this code

Summary

  • Install extension: VS Code, JetBrains, or other editors
  • Sign in: Authenticate with GitHub
  • Configure: Enable for desired languages
  • Customize shortcuts: Match your workflow
  • Organization settings: Content exclusion, policies

Next Steps

With Copilot installed, let's master the art of code completions—getting the best suggestions with minimal effort.

Mark this lesson as complete to track your progress