Use GitHub Copilot AI in Visual Studio — A Simple Guide

Ever wished your code could almost write itself? Meet GitHub Copilot — your AI-powered coding assistant! It helps by suggesting code snippets, completing functions, and even generating entire blocks of code based on what you’re working on.
💡Note: — For more information about billing please refer to https://docs.github.com/en/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot
In this guide, I’ll show you how to set up and use GitHub Copilot in Visual Studio, step by step, without any technical jargon.
Step 1: Install GitHub Copilot Extension
First things first, you need to install the Copilot extension in Visual Studio (not VS Code).
Here’s how:
- Open Visual Studio and go to Extensions > Manage Extensions.
- Search for “GitHub Copilot” in the Marketplace.
- Click Download and install it.
- Restart Visual Studio after installation (recommended).
✅ Done! Now let’s activate it.
Step 2: Sign in to GitHub
Since GitHub Copilot requires a GitHub account, you need to sign in.
- Click on “Sign in with GitHub” when prompted.
- Allow necessary permissions for Copilot to access your code.
💡 Note: If you don’t have a Copilot subscription, you might need to start a free trial or subscribe.
Step 3: Start Coding with Copilot
Now, the fun part! 🎉 Copilot works as soon as you start typing.
How to Use Copilot:
- Write a comment like
// Create a function to add two numbers
→ Copilot will suggest the function. - Start typing a function name, and it will autocomplete it for you.
- Press
Tab
to accept a suggestion orEsc
to ignore it.
// Function to calculate square of a number
int Square(int number) {
return ....... //Here Copilot might suggest this automatically as you type
}
Step 4: Customize Copilot Settings
Want Copilot to behave differently? You can tweak its settings!
- Go to Tools > Options > GitHub Copilot in Visual Studio.
- Choose when you want suggestions (e.g., inline, only in comments, etc.).
- Turn Copilot on/off for specific file types.
🔧 Pro Tip: If Copilot gives too many suggestions, you can disable it temporarily using Alt + \
(Windows) or Option + \
(Mac).
Step 5: Copilot Keyboard Shortcuts
Here are some handy shortcuts:
Final Thoughts
GitHub Copilot is like having an AI coding buddy — it helps speed up development, reduces typos, and even teaches you new coding tricks! Give it a try in Visual Studio, and you’ll be surprised at how much easier coding becomes.
💬 Have you tried GitHub Copilot yet? Let me know your thoughts in the comments!