1 minute read

While everyone is hyped about GitHub’s Copilot, I’ve discovered TabNine, an AI completion that I enjoy a lot.

tabnine-go

When Copilot is aiming to write the whole function for you, TabNine just tries to intelligently complete the current line.

Furthermore, the current implementation of Copilot for vim looks pretty hacky and doesn’t integrate with completion engines, while TabNine provides a completion source tzachar/cmp-tabnine for hrsh7th/nvim-cmp

Completion is provided by the local binary(which is installed automatically), so it feels really fast.

Installation is pretty straightforward and described in README.

In short, following steps are required:

  1. Install hrsh7th/nvim-cmp nvim completion engine
  2. Install tzachar/cmp-tabnine nvim-cmp completion source. Under the hood installation script will download and install binary
  3. Configure nvim-cmp to use TabNine source, i.e.:
    cmp.setup {
     sources = {
         { name = "buffer" },
         { name = "nvim_lsp" },
         { name = "cmp_tabnine" },
         ...
     },
    
  4. Adjust completion menu to your liking
  5. Setup TabNine

The cool thing here is that TabNine works with any filetype, whether it’s GO, Terraform or even with markdown.

tabnine-markdown

It’s free for individuals, so I highly recommend trying it. If you’ll like it, you can consider pro options

Enabling PRO version is possible, though not obvious. To do this:

  1. Open a new buffer
  2. Enter INSERT mode
  3. Type TabNine::config

A new browser window should pop up:

tabnine-upgrade

Check This Issue for more info

If you’re interested, feel free to check out my config files:

Update 2020-06-09

In PR #35 a new command :CmpTabnineHub was introduced.

This command makes in really easy to access the TabNine Hub

Tags:

Categories:

Updated:

Comments