GitHub Copilot in IntelliJ IDEA: Plugin Configuration Guide
🔍 WiseChecker

GitHub Copilot in IntelliJ IDEA: Plugin Configuration Guide

GitHub Copilot is an AI-powered code completion tool that suggests whole lines or blocks of code as you type. In IntelliJ IDEA, the plugin integrates directly into the editor, offering suggestions based on the context of your project. This article explains how to install, configure, and troubleshoot the GitHub Copilot plugin in IntelliJ IDEA. It covers prerequisites, step-by-step setup, common configuration mistakes, and a comparison of Copilot plans.

Key Takeaways: GitHub Copilot in IntelliJ IDEA Setup

  • IntelliJ IDEA Marketplace > Plugins > GitHub Copilot: Install the official plugin from JetBrains Marketplace.
  • File > Settings > Tools > GitHub Copilot: Configure suggestion behavior, keybindings, and authentication.
  • Ctrl+Shift+Enter or Alt+Insert: Accept or cycle through Copilot suggestions during code editing.

GitHub Copilot Plugin for IntelliJ IDEA: What It Does

GitHub Copilot acts as an AI pair programmer. It analyzes the code you write, including comments and function signatures, and generates relevant code snippets. The plugin works with all major languages supported by IntelliJ IDEA, including Java, Python, JavaScript, TypeScript, C++, and Go.

Before you start, you need a GitHub account with an active Copilot subscription. Copilot is available in two plans: Copilot Individual for 10 USD per month and Copilot Business for 19 USD per user per month. The Business plan includes organization management and policy controls. You also need IntelliJ IDEA version 2021.2 or later. The plugin is compatible with Community, Ultimate, and all other editions.

How Copilot Suggests Code

Copilot uses OpenAI Codex, a GPT-3 derived model trained on public GitHub repositories. When you type code, the plugin sends the current file context to GitHub servers. The model generates one or more completions. IntelliJ IDEA displays these as ghost text inline. You accept a suggestion with Tab or Ctrl+Shift+Enter. You can cycle through alternatives with Alt+Insert or Ctrl+Shift+Enter depending on your keymap.

Prerequisites Checklist

  • Active GitHub account with a paid Copilot subscription
  • IntelliJ IDEA 2021.2 or newer
  • Internet connection for authentication and suggestion generation
  • Optional: Organization admin access for Copilot Business policy setup

Install and Authenticate GitHub Copilot in IntelliJ IDEA

  1. Open IntelliJ IDEA and go to Settings
    Click File in the top menu, then select Settings. On macOS, use IntelliJ IDEA in the menu bar and choose Preferences.
  2. Navigate to Plugins
    In the Settings dialog, click Plugins in the left panel. Ensure the Marketplace tab is selected.
  3. Search for GitHub Copilot
    Type GitHub Copilot in the search bar. The official plugin appears as GitHub Copilot by GitHub. Click Install.
  4. Restart IntelliJ IDEA
    After installation, click Restart IDE to activate the plugin.
  5. Open the Copilot Tool Window
    After restart, click the Copilot icon in the right toolbar. The icon looks like a small robot head. Alternatively, use View > Tool Windows > GitHub Copilot.
  6. Authenticate with GitHub
    In the Copilot tool window, click Sign In. A browser window opens asking you to authorize the plugin. Log in to GitHub and approve the request. The plugin shows a success message.
  7. Verify Connection
    Open a code file. Start typing a function or a comment. Ghost text suggestions should appear. Press Tab to accept.

Configure Copilot Settings in IntelliJ IDEA

After installation, you can fine-tune how Copilot behaves. Open File > Settings > Tools > GitHub Copilot. The following options are available:

  • Enable Copilot: Toggle the plugin on or off globally.
  • Suggestion delay: Set a delay in milliseconds before suggestions appear. Default is 0 milliseconds.
  • Show suggestions as ghost text: Disable this to only show suggestions when you press a key.
  • Enable for all languages: Uncheck specific languages to disable Copilot for them.
  • Keybindings: Change the accept suggestion key from Tab to any other key.

Custom Keybindings for Copilot

IntelliJ IDEA lets you reassign all Copilot actions. Go to File > Settings > Keymap. Search for Copilot. You can change the following actions:

  • Accept Suggestion: Default is Tab.
  • Next Suggestion: Default is Alt+Insert or Ctrl+Shift+Enter.
  • Previous Suggestion: Default is Alt+Insert or Ctrl+Shift+Enter with modifier.
  • Toggle Copilot Enablement: Default is no shortcut. Assign one like Ctrl+Shift+.

Common Configuration Mistakes and How to Fix Them

Copilot Suggestions Do Not Appear

If ghost text is missing, first confirm the plugin is enabled. Check File > Settings > Tools > GitHub Copilot and ensure Enable Copilot is checked. Also verify your internet connection. Copilot sends code to GitHub servers and requires a live connection. If you are behind a corporate proxy, configure proxy settings in IntelliJ IDEA under File > Settings > Appearance & Behavior > System Settings > HTTP Proxy.

Authentication Fails Repeatedly

Authentication uses OAuth via your default browser. If the browser does not open, manually go to File > Settings > Tools > GitHub Copilot and click Reset Authentication. Then click Sign In again. If you use two-factor authentication, ensure you approve the request in your authenticator app. For Copilot Business, your GitHub organization owner must grant access to the Copilot plugin.

Copilot Slows Down IntelliJ IDEA

The plugin itself uses minimal local resources. However, network latency can cause delays. Increase the suggestion delay in Settings > Tools > GitHub Copilot to 200 milliseconds. This prevents Copilot from sending requests on every keystroke. Alternatively, disable Copilot for languages you rarely use.

Suggestions Are Inaccurate or Irrelevant

Copilot bases suggestions on the current file context. If your project has little existing code, suggestions may be generic. Write descriptive comments and function names to improve context. For example, instead of // calculate, write // calculate the total price with tax. Copilot also learns from your coding style over time. It does not store your code permanently, but it uses the session context.

Item Copilot Individual Copilot Business
Description Personal AI assistant for individual developers Team AI assistant with organization management
Price 10 USD per month 19 USD per user per month
Admin controls None Policy-based suggestion filtering and audit logs
Code exclusion Manual file exclusion via .gitignore Organization-wide exclusion policies
Supported IDEs IntelliJ IDEA, VS Code, Neovim, JetBrains suite Same as Individual

After completing the configuration, you can start using Copilot in your daily coding workflow. The plugin integrates with IntelliJ IDEA’s refactoring tools, debugger, and test runner. For advanced use, try Copilot Chat, a separate plugin that adds a chat panel for asking coding questions. The chat plugin is free for all Copilot subscribers.