Learn how to set up GitHub Copilot in VS Code, JetBrains IDEs, and Neovim. This guide covers installation, authentication, inline suggestions, Copilot Chat, best practices, and advanced configuration with custom instructions for code review.
This guide covers everything you need to know to get GitHub Copilot running in Visual Studio Code, JetBrains IDEs, and Neovim. It walks through prerequisites, installation, authentication, inline suggestions, Copilot Chat, and advanced configuration including custom instructions for code review. By the end, you will be able to set up Copilot in your preferred editor, write effective prompts, and tune its behavior to match your project's standards.
Before you start, you must have the following:
GitHub Copilot provides two primary ways to interact with it: inline suggestions and Copilot Chat. They serve different purposes and work best in different situations.
Inline suggestions appear as grayed-out text directly in your editor as you type. They are best for:
// function to calculate days between two dates will trigger a suggestion.Copilot Chat is a conversational interface that lets you ask questions in natural language. It is best for:

.js for JavaScript.function calculateDaysBetweenDates(begin, end) {
Create a complete task manager web application with the ability to add, delete, and mark tasks as completed. Include modern CSS styling and make it responsive. Use semantic HTML and ensure it's accessible. Separate markup, styles, and scripts into their own files.index.html file, create a styles.css file for styling, and a script.js file for functionality.You can enable or disable GitHub Copilot from within your editor and create your own preferred keyboard shortcuts. To configure Copilot:
.js for JavaScript.function calculateDaysBetweenDates(begin, end) {
what does this file do to get an explanation of the currently open file.explain this line in the chat window to get an explanation of that specific line.For vim-plug, add this to your init.vim or init.lua:
Plug "github/copilot.vim"
For lazy.nvim, add this to your init.lua:
{
"github/copilot.vim",
event = "InsertEnter",
}
:PlugInstall or :Lazy sync to install the plugin.:Copilot setup.Neovim does not have a native Copilot Chat plugin. However, you can use the GitHub Copilot CLI tool to ask questions from the terminal. Install the CLI by following the instructions at https://docs.github.com/en/copilot/using-github-copilot/using-the-github-copilot-cli. Then, in Neovim, you can use :!gh copilot explain or :!gh copilot suggest to interact with Copilot without leaving the editor.

GitHub Copilot is an AI coding assistant that helps you write code faster and with less effort, allowing you to focus more energy on problem solving and collaboration. Before you start working with Copilot, it is important to understand when you should and should not use it.
Some of the things Copilot does best include:
Copilot is not designed to:
Prompt engineering, or structuring your request so Copilot can easily understand and respond to it, plays a critical role in Copilot's ability to generate a valuable response. Here are a few quick tips you should remember while crafting your prompts:
While Copilot is very powerful, it is still a tool capable of making mistakes, and you should always validate the code it suggests. Use the following tips to ensure you are accepting accurate, secure suggestions:
Optionally, you may want to check Copilot's work for similarities to existing public code. If you do not want to use similar code, you can turn off suggestions matching public code in your Copilot settings.
There are several adjustments you can make to steer Copilot towards more valuable responses:
One of the most powerful features of Copilot is the ability to customize its behavior using a .github/copilot-instructions.md file in your repository. This is especially useful for code review, where you can teach Copilot to think like a maintainer.
Create a file named copilot-instructions.md in the .github directory of your repository. This file contains Markdown that tells Copilot how to behave when reviewing pull requests.
The following example, drawn from a real open-source project, shows how to tune Copilot for code review. The instructions are organized into sections that define the review philosophy, priority areas, project-specific context, CI pipeline context, items to skip, response format, and when to stay silent.
## Review Philosophy
* Only comment when you have HIGH CONFIDENCE (>80%) that an issue exists
* Be concise: one sentence per comment when possible
* Focus on actionable feedback, not observations
* When reviewing text, only comment on clarity issues if the text is genuinely confusing or could lead to errors.
## Priority Areas (Review These)
### Security & Safety
* Unsafe code blocks without justification
* Command injection risks (shell commands, user input)
* Path traversal vulnerabilities
* Credential exposure or hardcoded secrets
* Missing input validation on external data
* Improper error handling that could leak sensitive info
### Correctness Issues
* Logic errors that could cause panics or incorrect behavior
* Race conditions in async code
* Resource leaks (files, connections, memory)
* Off-by-one errors or boundary conditions
* Incorrect error propagation (using `unwrap()` inappropriately)
* Optional types that don't need to be optional
* Booleans that should default to false but are set as optional
* Error context that doesn't add useful information
* Overly defensive code with unnecessary checks
* Unnecessary comments that restate obvious code behavior
### Architecture & Patterns
* Code that violates existing patterns in the codebase
* Missing error handling (should use `anyhow::Result`)
* Async/await misuse or blocking operations in async contexts
* Improper trait implementations
## Project-Specific Context
* This is a Rust project using cargo workspaces
* Core crates: `goose`, `goose-cli`, `goose-server`, `goose-mcp`
* Error handling: Use `anyhow::Result`, not `unwrap()` in production
* Async runtime: tokio
* See HOWTOAI.md for AI-assisted code standards
* MCP protocol implementations require extra scrutiny
## CI Pipeline Context
**Important**: You review PRs immediately, before CI completes. Do not flag issues that CI will catch.
### What Our CI Checks (`.github/workflows/ci.yml`)
**Rust checks:**
* cargo fmt --check
* cargo test --jobs 2
* ./scripts/clippy-lint.sh
* just check-openapi-schema
**Desktop app checks:**
* npm ci
* npm run lint:check
* npm run test:run
**Setup steps CI performs:**
* Installs system dependencies
* Activates hermit environment
* Caches Cargo and npm deps
* Runs npm ci before scripts
**Key insight**: Commands like `npx` check local node_modules first. Don't flag these as broken unless CI wouldn't handle it.
## Skip These (Low Value)
Do not comment on:
* Style/formatting (rustfmt, prettier)
* Clippy warnings
* Test failures
* Missing dependencies (npm ci covers this)
* Minor naming suggestions
* Suggestions to add comments
* Refactoring unless addressing a real bug
* Multiple issues in one comment
* Logging suggestions unless security-related
* Pedantic text accuracy unless it affects meaning
## Response Format
1. State the problem (1 sentence)
2. Why it matters (1 sentence, if needed)
3. Suggested fix (snippet or specific action)
Example:
This could panic if the vector is empty. Consider using `.get(0)` or adding a length check.
## When to Stay Silent
If you're uncertain whether something is an issue, don't comment.
Review Philosophy section sets the tone: only comment with high confidence, be concise, and focus on actionable feedback. This immediately cuts down noise.Priority Areas section tells Copilot exactly what to look for. Without this, Copilot might nitpick on style or minor issues. With this, it focuses on security, correctness, and architecture.Project-Specific Context section provides essential background. Copilot does not magically know your setup. You have to tell it what kind of project it is reviewing, what error handling patterns to use, and what crates are involved.CI Pipeline Context section prevents Copilot from flagging issues that CI will catch anyway. This is important because Copilot reviews PRs immediately, before CI completes.Skip These section tells Copilot what not to bother with. This eliminates low-value comments about formatting, test failures, or minor naming suggestions.Response Format section enforces a concise structure: state the problem, why it matters, and a suggested fix.When to Stay Silent section reminds Copilot that silence is sometimes the right call.After setting up custom instructions, the difference can be immediate. However, this is not a one-time fix. As more PRs come in, watch how Copilot responds and refine the instructions each time. Expect to observe, adjust, and keep teaching it as your project evolves.
If you experience authentication issues, try the following:
:Copilot setup again.http.proxy in settings. In JetBrains, configure proxy settings in File > Settings > Appearance & Behavior > System Settings > HTTP Proxy.Once you have Copilot set up and working, there are several areas to explore next:
.github/copilot-instructions.md to tune Copilot's behavior for code review and other tasks.Learn how to use GitHub Copilot to convert issues into pull requests while managing premium request quotas. Covers model selection, step-by-step implementation, and community-tested workflow patterns.
Learn how to use GitHub Copilot for terminal command suggestions, including setup in Windows Terminal and VS Code, custom keybindings for commit messages, usage tracking with community tools, and creative CLI projects.
Learn how to build and use GitHub Copilot custom instructions to make the AI behave predictably in your repos. Covers setup, writing techniques, three generation methods, and real-world troubleshooting.
Learn how to set up and tune GitHub Copilot Code Review for automated PR feedback. Covers enabling the feature, writing custom instructions to reduce noise, and iterating on the setup for long-term value.
Master Copilot Agent Mode with practical examples for multi-file editing, terminal commands, and autonomous coding workflows.
Learn to build GitHub Copilot Extensions using the Extensions API to create custom chat participants, slash commands, and MCP integrations.
Workflows from the Neura Market marketplace related to this CoPilot resource