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
According to the repo's README, we need to install Node.js v12 or newer.
Then install a NeoVim prerelease build. Or in my case I'll use Hombrew:
brew install neovim --HEAD
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).
Just kidding, let's try it, btw to accept the Copilot suggestion you just need to press Tab
Uhh actually, this seems like code I wrote before
Now I need to customise NeoVim like my Vim
Resources:
github/copilot.vim