clients/vim/README.md
Tabby is a self-hosted AI coding assistant that can suggest multi-line code or full functions in real-time. For more information, please check out our website and GitHub.
If you encounter any problems or have any suggestions, please open an issue or join our Slack community for support.
Since version 2.0, the vim-tabby plugin is designed as two parts:
textDocument/inlineCompletion) to communicate with the tabby-agent.npx tabby-agent --stdio.The Tabby plugin requires the following dependencies:
npm install --global tabby-agent
+textprop features enabled. This is required for inline completion ghost text rendering.You can install the Tabby plugin using your favorite plugin manager by simply adding TabbyML/vim-tabby to the registry.
Here is a detailed example setup with advanced options, based on Neovim, Lazy.nvim, and nvim-lspconfig.
-- ~/.config/nvim/init.lua
require("lazy").setup({
-- other plugins
-- ...
-- Tabby plugin
{
"TabbyML/vim-tabby",
lazy = false,
dependencies = {
"neovim/nvim-lspconfig",
},
init = function()
vim.g.tabby_agent_start_command = {"npx", "tabby-agent", "--stdio"}
vim.g.tabby_inline_completion_trigger = "auto"
end,
},
})
After setting up the plugin, you can open a file in Neovim and use :LspInfo to check if the Tabby plugin is successfully connected.
The Tabby plugin requires a Tabby server to work. Follow the documentation to install and create your account.
Edit the tabby-agent config file located at ~/.tabby-client/agent/config.toml to set up the server endpoint and token. This file may have been auto-created if you have previously used the tabby-agent or Tabby plugin for other IDEs. You can also manually create this file.
```toml
[server]
endpoint = "http://localhost:8080"
token = "your-auth-token"
```
Tabby suggests code completions in real-time as you write code. You can also trigger the completion manually by pressing <C-\>. To accept suggestions, simply press the <Tab> key. You can also continue typing or explicitly press <C-\> again to dismiss it.
Tabby will attempt to set up the <Tab> key mapping to accept the inline completion and will fall back to the original function mapped to it. There could be a conflict with other plugins that also map the <Tab> key. In such cases, you can use a different keybinding to accept the completion to avoid conflicts.
Tabby internally utilizes the <C-R><C-O> command to insert the completion. If you have mapped it to other functions, the insertion of the completion text may fail.
You can find a detailed explanation of tabby-agent configurations in the Tabby online documentation.
Here is a table of all configuration variables that can be set when the Tabby plugin initializes:
| Variable | Default | Description |
|---|---|---|
g:tabby_agent_start_command | ["npx", "tabby-agent", "--stdio"] | The command to start the tabby-agent |
g:tabby_inline_completion_trigger | "auto" | The trigger mode of inline completion, can be "auto" or "manual" |
g:tabby_inline_completion_keybinding_accept | "<Tab>" | The keybinding to accept the inline completion |
g:tabby_inline_completion_keybinding_trigger_or_dismiss | "<C-\>" | The keybinding to trigger or dismiss the inline completion |
g:tabby_inline_completion_insertion_leading_key | "\<C-R>\<C-O>=" | The leading key sequence to insert the inline completion text |
Repository TabbyML/vim-tabby is for releasing Tabby plugin for Vim and Neovim. If you want to contribute to Tabby plugin, please check our main repository TabbyML/tabby.