Setting Up and Using GitHub Copilot in VSCode

Overview

This article explains how to set up and use GitHub Copilot in VSCode. A GitHub Copilot account is required as a prerequisite.

Getting Started with GitHub Copilot in VSCode

Installing the Extension

First, you need to install the extension in VSCode. Open VSCode, click on the icon with four squares in the left menu, enter “copilot” in the search text input, and click “install” to start the installation.

Extension

Linking with GitHub

After clicking install and completing the installation, the following screen will appear. Click on “Sign in to GitHub.”

Sing in to GitHub Screen

You will be asked to allow access to your GitHub account. Click “Allow” to grant permission.

Access Permission Screen

Click “Authorize Visual Studio Code” to give permission.

Confirmation Screen

This completes the integration of GitHub Copilot with VSCode, and you’re now ready to use it.

How to Use

Basically, as you write code, suggestions will automatically appear. Use the following commands to write code efficiently with the suggested completions.

Cheat Sheet

Function Key
Accept suggestion Tab
Reject suggestion Esc
Open Copilot Ctrl + Enter
Next suggestion Alt/Option + ]
Previous suggestion Alt/Option + [
Trigger inline Copilot Alt/Option + \

Summary

This article covered how to set up and use GitHub Copilot in VSCode.
GitHub Copilot not only provides code completions but also assists with writing text.

This blog was also written with the assistance of GitHub Copilot, significantly improving efficiency.
Give it a try and see how it can help you.