- Learn
- AI Code Editors
- GitHub Copilot
- Setting Up GitHub Copilot
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:
- GitHub Account: Sign up at github.com
- Copilot Subscription: Individual, Business, or Enterprise
- Supported Editor: VS Code, JetBrains, Neovim, etc.
Getting a Subscription
- Go to github.com/features/copilot
- Click "Start my free trial" (30 days free)
- 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
- Open VS Code
- Go to Extensions (
Cmd/Ctrl+Shift+X) - Search "GitHub Copilot"
- Install both:
- GitHub Copilot: Code completions
- GitHub Copilot Chat: Conversational assistance
Or via command line:
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat
Step 2: Sign In
- Click the Copilot icon in the status bar
- Click "Sign in to GitHub"
- Authorize in browser
- Return to VS Code
You should see the Copilot icon become active (no warning symbol).
Step 3: Verify Installation
Create a test file:
// 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
- Open Settings/Preferences (
Cmd/Ctrl+,) - Go to Plugins
- Search "GitHub Copilot"
- Click Install
- Restart the IDE
Step 2: Sign In
- Open Settings/Preferences
- Go to Tools > GitHub Copilot
- Click Login to GitHub
- 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:
{
"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:
use {
"zbirenbaum/copilot.lua",
config = function()
require("copilot").setup()
end,
}
Authentication
Run in Neovim:
:Copilot auth
Follow the browser prompt to authenticate.
Other Editors
Visual Studio
- Extensions > Manage Extensions
- Search "GitHub Copilot"
- Download and install
- Restart Visual Studio
- 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:
Plug 'github/copilot.vim'
Run :Copilot setup to authenticate.
Configuration Options
VS Code Settings
Open settings (Cmd/Ctrl+,) and search "Copilot":
{
// 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:
{
"github.copilot.enable": {
"*": true,
"yaml": false,
"markdown": false,
"json": false
}
}
Keyboard Shortcuts
Default VS Code shortcuts:
| Action | macOS | Windows/Linux |
|---|---|---|
| Accept suggestion | Tab | Tab |
| Dismiss suggestion | Esc | Esc |
| Next suggestion | Alt+] | Alt+] |
| Previous suggestion | Alt+[ | Alt+[ |
| Open completions panel | Ctrl+Enter | Ctrl+Enter |
| Open Copilot Chat | Cmd+Shift+I | Ctrl+Shift+I |
Customize in Keyboard Shortcuts:
{
"key": "ctrl+g",
"command": "github.copilot.generate",
"when": "editorFocus"
}
Organization Settings
For Copilot Business/Enterprise:
Admin Configuration
In GitHub Organization Settings:
- Go to Settings > Copilot
- Configure policies:
- Who can use Copilot
- Suggestion matching (public code)
- Data retention
- Telemetry
Content Exclusion
Exclude files from Copilot context:
# .github/copilot-content-exclusion.yaml
- "*.env"
- "**/.env.*"
- "secrets/**"
- "config/production/**"
Or in repository settings:
- Settings > Code security and analysis
- Configure content exclusion patterns
Proxy Configuration
For corporate networks:
VS Code
{
"http.proxy": "http://proxy.company.com:8080",
"http.proxyStrictSSL": false
}
JetBrains
Settings > Appearance & Behavior > System Settings > HTTP Proxy
Environment Variables
export HTTP_PROXY="http://proxy.company.com:8080"
export HTTPS_PROXY="http://proxy.company.com:8080"
Troubleshooting
"Copilot is not available"
- Check subscription status at github.com/settings/copilot
- Verify you're signed in with the correct account
- Check for extension updates
Suggestions Not Appearing
- Ensure the file type is not disabled
- Check status bar for Copilot icon state
- 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:
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
# 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:
What's the best way to sort a list in Python?
3. Test Inline Chat
Select code and press Cmd+I:
/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.