Gerard Altamirano

GitHub
~1 min read

Using Github copilot in Vim (NeoVim)

This week I received an email telling me that I'm in the Github Copilot Technical Preview (whoaaa got tired typing that). Pitifully, ~the hype is sorta gone and~ it said that Copilot was only available in VSCode and JetBrains IDEs. And it's ok, but I use Vim as my main editor (yup I'm that weird dev 🤖; looks cool, though).

Fortunately,today when I woke up and checked my email I found a Github repo that can help me to use Copilot in Vim (well, NeoVim). So let's try it! (literally, I'm writing this and trying the repo, so if you're reading this post means that all went Gucci)

Installation

  1. According to the repo's README, we need to install Node.js v12 or newer.

  2. Then install a NeoVim prerelease build. Or in my case I'll use Hombrew:

brew install neovim --HEAD
  1. And finally install github/copilot.vim using any plugin manager we prefer. Or in my case, directly cloning the repo:
git clone https://github.com/github/copilot.vim.git \
  ~/.config/nvim/pack/github/start/copilot.vim

Now you can open NeoVim and setup Copilot running :Copilot setup to setup Copilot (duh).

You'll be ask for login with Github (so they can see you're in the technical preview) with a code that the plugin will provide.

And you'll need to agree the telemetry terms, after you read it carefully (all we know that it's probably you won't read it, but well just tried to sound cool).

That's it, let's see copilot in action and in High Resolution (read with narrator voice with echo).

Uhh actually, this seems like code I wrote before

Resources:

github/copilot.vim