Installation
Install the GitHub Copilot extension in VS Code from the Extensions marketplace. Sign in with your GitHub account that has an active Copilot subscription.
Basic Usage
Copilot activates automatically as you type. Key interactions:
- **Accept suggestion:** Press Tab
- **See alternatives:** Alt+] / Alt+[
- **Dismiss:** Escape
- **Trigger manually:** Alt+\
Copilot Chat
Open Copilot Chat with Ctrl+Shift+I. Ask it to:
- Explain selected code
- Write unit tests for a function
- Fix a specific bug
- Refactor for readability
Writing Effective Prompts
Copilot works best with context. Add detailed comments before functions describing what you want, include example inputs/outputs, and be specific about language and library preferences.
Workspace Commands
Use /fix, /tests, /explain, /doc as slash commands in Copilot Chat for structured assistance.