Skip to main content

Guide to 100% Maximizing GitHub Copilot

· 5 min read

Long before OpenAI launched ChatGPT, OpenAI had already partnered with GitHub to launch GitHub Copilot.

Hereinafter referred to as Copilot

Copilot caused a sensation in the programming community at that time.

The radical claim back then was: Copilot will replace programmers.

Three years later, calm down - Copilot hasn't replaced programmers as hoped.

Instead, it's a powerful assistant that improves efficiency. Mastering it can multiply your programming efficiency.

Copilot Pricing

Domestic developers are relatively price-sensitive.

Copilot officially offers two subscription types: Individual and Team.

Let's skip the team version - if you have company support, you don't need to worry about this.

Individual pricing comes in two options:

  1. Monthly subscription, $10 per month, ¥72.37 RMB
  2. Annual subscription, $100 per year, ¥723.7 RMB

The individual version includes a 30-day free trial period, so you can try it first.

GitHub is quite friendly - it supports domestic credit card payment, including China Merchants Bank, GuangFa Bank, China Construction Bank, etc.

For unofficial channels like Taobao or uTools plugins, they might be unstable but are cheaper.

Copilot Family Suite

Using Copilot is simple - install the corresponding plugin in VSCode/JetBrains, then log in with your GitHub account.

👉 VSCode: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot 👉 JetBrains: https://plugins.jetbrains.com/plugin/17718-github-copilot

After installation, when typing code, Copilot will automatically suggest code. Press Tab to complete.

JetBrains' Copilot plugin integration provides sidebar Chat functionality:

For VSCode users, to enable sidebar Chat functionality, you need to install the additional Copilot Chat plugin:

After installation, the sidebar menu will have a new "Chat" option, with a chat interface like ChatGPT:

VSCode is indeed a bit more troublesome, but has an advantage.

New Copilot features will be launched on VSCode first, like Copilot Voice.

Install this plugin in VSCode 👇 to experience voice programming.

Although it currently only supports English, multilingual support will surely come soon.

Speech to text in Visual Studio Code Chat

Even with English-only support, I believe Chinese developers who've been learning English since childhood have excellent English skills.

Copilot Code Completion

Besides Copilot's automatic triggering, we can also use Option + \ to manually trigger code completion.

Windows: Alt + \

Although the manual shortcut is rarely used, it's useful for testing Copilot during network fluctuations.

After triggering code completion, pressing Tab accepts all the code, but sometimes we only need partial completion.

You can use Command + → to accept completion code step by step:

Windows: Ctrl + →

If you're not satisfied with the current completion, you can press Option + ] or Option + [ to switch to the next or previous completion:

Windows: Alt + ] or Alt + [

For VSCode, press Command + I to invoke Copilot Editor in code:

Windows: Ctrl + I

Using Copilot Chat

Copilot Chat is like having GPT-4 directly in your editor, allowing quick Q&A about project issues:

For JetBrains IDEs, you need to right-click on files to show references:

JetBrains IDEs are currently clumsy, requiring manual right-clicking to specify files and referencing entire files.

VSCode doesn't need explicit specification - it automatically determines whether to reference the entire file or just the selected portion:

Some Small Joys with Copilot

Let me mention some of Copilot's nice-to-have features, like directly generating Commit Messages:

Generating Git Commits is really convenient - it detects all file changes and generates appropriate messages.

Another feature is variable renaming, though it's currently unstable, so I'll skip it for now.

Copilot CLI

Copilot CLI is now fully available, allowing you to use Copilot in the command line.

For example, we can ask Copilot to explain what the sudo apt-get command means:

However, CLI is still quite dumb. It's better to use Warp's AI features, as mentioned in my previous article 👉

Beautiful, Functional + Free AI-Powered Terminal Tool: Recommending Warp!