Skip to content

Gerard Altamirano

Using Github copilot in Vim (NeoVim)

Tutorial, Vim, NeoVim, NVim, Github, Copilot, Gerard Altamirano, TheJarX1 min read

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:

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

So now you can open NeoVim and setup Copilot:

1nvim

And then Run :Copilot setup to setup Copilot (duh).

copilot setup

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).

copilot telemetry terms

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

copilot meme

Just kidding, let's try it, btw to accept the Copilot suggestion you just need to press Tab

copilot

Uhh actually, this seems like code I wrote before

Now I need to customise NeoVim like my Vim

Resources:

© 2021 by Gerard Altamirano. All rights reserved.
Theme by LekoArts