• Stars
    star
    290
  • Rank 142,981 (Top 3 %)
  • Language
    HTML
  • Created almost 2 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tabnine Client for Neovim

tabnine-nvim

Tabnine client for Neovim

Tabnine Neovim client

Install

Note this plugin requires having Neovim version >= v0.7

The Unix build script requires curl and unzip to be available in your $PATH

Unix (Linux, MacOS)

Using vim-plug

  1. Add the following in your init.vim
call plug#begin()
Plug 'codota/tabnine-nvim', { 'do': './dl_binaries.sh' }
call plug#end()
  1. Restart Neovim and run :PlugInstall

Using packer

  1. Add the following in your init.lua:
require("packer").startup(function(use)
  use { 'codota/tabnine-nvim', run = "./dl_binaries.sh" }
end)
  1. Restart Neovim and run :PackerInstall

Using lazy.nvim

  1. Add the following in your init.lua:
require("lazy").setup({
  { 'codota/tabnine-nvim', build = "./dl_binaries.sh" },
})
  1. Restart Neovim and run :Lazy

Windows

The build script needs a set execution policy. Here is an example on how to set it

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

For more information visit the official documentation

Windows installations need to be adjusted to utilize PowerShell. This can be accomplished by changing the do/run/build parameter in your plugin manager's configuration from ./dl_binaries.sh to pwsh.exe -file .\\dl_binaries.ps1

-- Example using lazy.nvim
-- pwsh.exe for PowerShell Core
-- powershell.exe for Windows PowerShell

require("lazy").setup({
  { 'codota/tabnine-nvim', build = "pwsh.exe -file .\\dl_binaries.ps1" },
})

If you need to use Tabnine on Windows and Unix you can change the config as follows

-- Get platform dependant build script
local function tabnine_build_path()
  if vim.loop.os_uname().sysname == "Windows_NT" then
    return "pwsh.exe -file .\\dl_binaries.ps1"
  else
    return "./dl_binaries.sh"
  end
end
require("lazy").setup({
  { 'codota/tabnine-nvim', build = tabnine_build_path()},
})

Activate (mandatory)

Add this later in your init.lua:

require('tabnine').setup({
  disable_auto_comment=true,
  accept_keymap="<Tab>",
  dismiss_keymap = "<C-]>",
  debounce_ms = 800,
  suggestion_color = {gui = "#808080", cterm = 244},
  exclude_filetypes = {"TelescopePrompt"},
  log_file_path = nil, -- absolute path to Tabnine log file
})

init.vim users - the activation script is lua code. Make sure to have it inside lua block:

lua <<EOF
" activate tabnine here
EOF

Activate Tabnine Pro

:TabnineHub - to open Tabnine Hub and log in to your account

Sometimes Tabnine may fail to open the browser on Tabnine Hub, in this case use :TabnineHubUrl to get Tabnine Hub URL

Commands

  • :TabnineStatus - to print Tabnine status
  • :TabnineDisable - to disable Tabnine
  • :TabnineEnable - to enable Tabnine
  • :TabnineToggle - to toggle enable/disable

<Tab> and nvim-cmp

nvim-cmp maps <Tab> to navigating through pop menu items (see here) This conflicts with Tabnine <Tab> for inline completion. To get this sorted you can either:

  • Bind Tabnine inline completion to a different key using accept_keymap
  • Bind cmp.select_next_item() & cmp.select_prev_item() to different keys, e.g: <C-k> & <C-j>

lualine integration

This plugin exposes a lualine tabnine component. e.g:

require('lualine').setup({
    tabline = {
        lualine_a = {},
        lualine_b = {'branch'},
        lualine_c = {'filename'},
        lualine_x = {},
        lualine_y = {},
        lualine_z = {}
    },
    sections = {lualine_c = {'lsp_progress'}, lualine_x = {'tabnine'}}
})

Other statusline integrations

To render tabnine status widget use:

require('tabnine.status').status()

Tabnine Enterprise customers (self hosted only)

In your init.lua:

these instructions are made for packer, but are pretty much the same with all package managers

local tabnine_enterprise_host = "https://tabnine.customer.com"

require("packer").startup(function(use)
  use { 'codota/tabnine-nvim', run = "./dl_binaries.sh " .. tabnine_enterprise_host .. "/update" }
end)

require('tabnine').setup({
  disable_auto_comment=true,
  accept_keymap="<Tab>",
  dismiss_keymap = "<C-]>",
  debounce_ms = 800,
  suggestion_color = {gui = "#808080", cterm = 244},
  exclude_filetypes = {"TelescopePrompt"},
  log_file_path = nil, -- absolute path to Tabnine log file,
  tabnine_enterprise_host = tabnine_enterprise_host
})

More Repositories

1

TabNine

AI Code Completions
Shell
10,342
star
2

tabnine-vscode

Visual Studio Code client for Tabnine. https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode
TypeScript
1,327
star
3

jupyter-tabnine

Autocompletion with Deep Learning on Jupyter Notebook
JavaScript
787
star
4

tabnine-intellij

Jetbrains IDEs client for TabNine. Compatible with all IntelliJ-based IDEs. https://plugins.jetbrains.com/plugin/12798-tabnine
Kotlin
498
star
5

tabnine-sublime

Tabnine Autocomplete AI: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin, Julia, Lua, OCaml, Perl, Haskell, React
Python
195
star
6

tabnine-jupyterlab

JupyterLab client for Tabnine. https://pypi.org/project/jupyterlab-tabnine/
TypeScript
34
star
7

codota-sdk-samples

Sample code for using the Codota SDK
Java
14
star
8

codota-plugin-intellij

Hub for all issues related to the Codota plugin for the JetBrains platforms: IntelliJ, Android Studio, WebStorm & PhpStorm
9
star
9

codota-maven-plugin

Maven plugin for indexing java/scala code in Codota
Java
7
star
10

tabnine-community-endorsed-powershell

5
star
11

codota-plugin-eclipse

Hub for all issues related to the Codota plugin for eclipse
2
star
12

terraform-google-gke-tabnine

Resilient and fault tolerant Tabnine installation using Google Kubernetes Engine (GKE)
HCL
2
star
13

tabnine-pr-agent

This repository contains the tabnine PR agent
2
star
14

visual-regression

Send slack message with visual regressions
TypeScript
1
star
15

tabnine-rust-community-model

Add your favorite rust repos, to help us build and train the specialized Rust model for the Rustaceans!
1
star
16

tabnine-vscode-self-hosted-updater

TypeScript
1
star