Skip to main content

在 Neovim 中配置 GitHub Copilot

您可以在 Neovim 中启用、配置和禁用 GitHub Copilot。

GitHub Copilot is available to GitHub customers with a personal account on GitHub.com. GitHub Copilot is free to use for verified students and maintainers of popular open source projects. If you are not a student or maintainer of a popular open source project, you can try GitHub Copilot for free with a one-time 60 day trial. After the free trial, you will need a paid subscription for continued use. 更多信息请参阅“关于 GitHub Copilot 的计费”。

在 Neovim 中配置 GitHub Copilot

有关在 Neovim 中配置 GitHub Copilot 的指南,请通过运行以下命令调用 Neovim 中的 GitHub Copilot 文档。

:help copilot

Configuring GitHub Copilot settings on GitHub.com

Once you have an active GitHub Copilot trial or subscription, you can adjust GitHub Copilot settings for your personal account on GitHub in the GitHub Copilot settings. The settings apply anywhere that you use GitHub Copilot. You can configure the suggestions that GitHub Copilot offers and how GitHub uses your telemetry data.

Enabling or disabling duplication detection

GitHub Copilot includes a filter which detects code suggestions matching public code on GitHub. You can choose to enable or disable the filter. When the filter is enabled, GitHub Copilot checks code suggestions with their surrounding code of about 150 characters against public code on GitHub. If there is a match or near match, the suggestion will not be shown to you.

  1. 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)

    用户栏中的 Settings 图标

  2. In the left sidebar, click GitHub Copilot.

  3. Under Suggestions matching public code, select the dropdown menu, then click Allow to allow suggestions matching public code, or Block to block suggestions matching public code. Screenshot of duplication detection option

  4. To confirm your new settings, click Save.

Enabling or disabling telemetry

You can choose whether your code snippets are collected and retained by GitHub and further processed and shared with Microsoft and OpenAI by adjusting your user settings. For more information about data that GitHub Copilot may collect depending on your telemetry settings, see "GitHub Terms for Additional Products and Features" and the GitHub Copilot privacy FAQ.

  1. 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)

    用户栏中的 Settings 图标

  2. In the left sidebar, click GitHub Copilot.

  3. To allow or prevent GitHub using your telemetry data, select or deselect Allow GitHub to use my code snippets for product improvements. Screenshot of telemetry option

  4. To confirm your new settings, click Save.

延伸阅读