Table of Contents

GitHub Copilot layer

Table of ContentsClose

1. Description

This layer enables usage of GitHub Copilot in Spacemacs.

1.1. Features:

2. Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add github-copilot to the existing dotspacemacs-configuration-layers list in this file.

In addition the github/copilot-language-server must be installed either manually with:

$ npm install -g @github/copilot-language-server

or via elisp by pressing:

SPC SPC copilot-install-server

2.1. Configuratiom

Per default the service will run for every mode derived from prog mode. It will do automatic code suggestions. Key bindings for accepting an advice are bound automatically but can be rebound.

In order to work properly SPC SPC copilot login must be have been run once on the device especially if a commercial license is available.

The mode itself tries to defer the language from the major mode however if this fails it may be necessary to add the new binding manually. Details for this can be found here.

For the chat interface a separate login procedure will be necessary once a chat is started.

3. Key bindings

3.1. General

Key binding Description
C-M-<return> accept the current completion suggestion
C-M-S-<return> accept the current completion suggestion word by word
C-M-<tab> show the next github copilot completion (and refresh completions)
C-M-<iso-lefttab> show the previous github copilot completion (and refresh completions)
SPC $ c Start a transient state to interact with Github Copilots chat interface

3.2. In Chat

Key binding Description
,, sent the current text to copilot
,a kill a chat process
,k kill a chat process
C-c-<return> sent the current text to copilot
C-c-C-c sent the current text to copilot
C-c-C-a kill a chat process
C-c-C-k kill a chat process

Author: root

Created: 2025-05-15 Thu 05:19

Validate