Copilot
Our configuration includes the Copilot integration, so these steps set it up. If you would rather not use it, skip this page — nothing else in the guide depends on it, and the last section here explains how to leave it switched off.
Copilot needs a GitHub account. There is a free plan, verified students can get the Copilot Student plan at no cost through GitHub Education, and verified teachers may be eligible for free access to Copilot Pro; see GitHub’s plans page for what each includes.
Our configuration sets up Copilot only when the quelpa package is installed, and it does not install quelpa for you. To install it, type Option+x, then type package-install. Enter. Then type quelpa. Enter. When it finishes, close Emacs and reopen it.
Now that you have reopened Emacs, you should see some messages at the bottom about “quelpa” or “copilot”. When these messages stop appearing, we need to complete a few Emacs commands to fully integrate with Copilot.
Now, type:
- Option+x then type copilot-mode. Enter. This may give you prompts about logging in or installing the server. Follow each as they come up:
- Option+x copilot-install-server. Enter. When this is done, you may get a message saying that there is a newer version. You will need to do the next step, then. If not, skip the next step.
- Option+x copilot-reinstall-server. Enter. (Again, you may not need to do this!)
- Option+x copilot-login. Enter. If you have already authorized Copilot on your computer (e.g., in RStudio), this may not be necessary. This will give you a code to copy. Write it down. Follow the instructions, then press enter to access GitHub in your browser. Authorize your GitHub/Copilot in the browser according to the instructions.
Now we are going to close Emacs and reopen it.
There should be a few messages on start-up, but nothing that you need to do.
To turn on Copilot mode, type: Option-x copilot-mode. Enter. At the bottom, it should tell you that copilot mode is enabled in the buffer.
Copilot should now be integrated! If you pause when typing, suggestions should pop up for you. If not, try typing Option-x copilot-mode a few times, toggling it off/on again.
If you ever want to stop using it, or if you don’t have Copilot, just don’t turn on copilot-mode.