Supermaven has rapidly earned a dedicated following among terminal-first developers due to its sub-100ms streaming latency and massive context window. In Neovim, however, pairing supermaven-nvim with the industry-standard completion engine nvim-cmp frequently triggers a frustrating collision: both plugins default to <Tab>, causing keystroke hijacking, broken snippet expansions, and chaotic visual overlapping between Supermaven's inline ghost text and nvim-cmp's floating popup menu.
At 365Finds, our research stance is unequivocal: do not castrate Supermaven's multi-line speed by forcing it into a standard nvim-cmp dropdown list. The optimal architecture preserves Supermaven as an independent inline ghost-text engine while dynamically suppressing it during active popup menus and cleanly decoupling your keymap layers.
Here is how to understand the architectural trade-offs and configure a robust, zero-collision Neovim environment.
The Root Causes: Why Supermaven and nvim-cmp Collide
To resolve the collision permanently, you must first isolate the two distinct mechanisms causing friction:
1. The <Tab> Keymap Collision
By default, supermaven-nvim attaches an insert-mode mapping to <Tab> to accept inline suggestions (accept_suggestion). Simultaneously, standard nvim-cmp configurations map <Tab> to navigate candidate lists (cmp.select_next_item()) or advance through snippet placeholders (luasnip.expand_or_jump()). When both plugins register competing handlers on <Tab>, race conditions occur:
- Supermaven consumes
<Tab>, blocking you from selecting an LSP suggestion or jumping to the next parameter in a function snippet. - Alternatively,
nvim-cmpconsumes<Tab>, inserting a tab or advancing the menu while ignoring a valid full-block AI completion.
2. Ghost-Text Rendering Collision
Supermaven renders inline completions via virtual extmarks right after the cursor. When you trigger standard LSP completion—such as typing an object property (user.)—nvim-cmp renders a floating window adjacent to the cursor while Supermaven simultaneously displays multi-line gray virtual text behind or through the menu. This creates visual flickering, line distortion, and cognitive overload because the developer cannot predict which suggestion an accept key will apply.
Architectural Comparison: Inline Mode vs. cmp Source Mode
When integrating Supermaven into Neovim, you face two architectural paths:
| Dimension | Option A: Decoupled Inline Mode (365Finds Choice) | Option B: Unified Super-Tab Inline Mode | Option C: Integrated cmp Source Mode |
|---|---|---|---|
| Rendering Strategy | Native inline virtual ghost text | Native inline virtual ghost text | nvim-cmp floating dropdown item |
| Multi-line Display | Full code block streaming | Full code block streaming | Truncated single-line dropdown label |
Word-by-Word (<C-j>) | Full native support | Full native support | Unsupported (requires full item confirmation) |
| Keymap Mental Model | Clean separation: AI vs. LSP keys | Single overloaded <Tab> with fallback | Standard nvim-cmp confirmation keys |
| Ghost Text Overlap | Completely eliminated via condition | Completely eliminated via condition | Zero (no ghost text rendered) |
| 365Finds Recommendation | Primary Recommendation | Secondary (If attached to single Tab) | Not Recommended for AI-heavy workflows |
Why 365Finds Recommends Decoupled Inline Mode
The core commercial value of Supermaven lies in its streaming velocity and multi-line synthesis. Folding Supermaven into an nvim-cmp dropdown entry (Option C) reduces a multi-line predictive block into a truncated string subject to cmp's menu sorting, filtering algorithms, and debouncing delays. You forfeit both the immediate visual clarity of inline code blocks and the ability to stream word-by-word with <C-j>.
The highest-performing setup leaves Supermaven in inline mode, suppresses ghost text when the cmp menu opens, and uses separated keymaps to eliminate ambiguity.
Solution 1: Decoupled Keymaps with Dynamic Suppression (Recommended)
This architecture gives you the fastest, most predictable workflow. Supermaven retains <Tab> for instant code block acceptance and <C-j> for incremental word acceptance, while nvim-cmp relies on native Vim navigation (<C-n>, <C-p>, <CR>).
Crucially, Supermaven's condition callback is configured to return true whenever nvim-cmp is visible, which pauses ghost-text rendering and guarantees zero visual overlap.
Complete Lazy.nvim Implementation
return {
-- 1. Configure Supermaven
{
"supermaven-inc/supermaven-nvim",
event = "InsertEnter",
config = function()
require("supermaven-nvim").setup({
keymaps = {
accept_suggestion = "<Tab>",
clear_suggestion = "<C-]>",
accept_word = "<C-j>",
},
ignore_filetypes = { "TelescopePrompt", "gitcommit", "markdown" },
color = {
suggestion_color = "#8a8a8a",
cterm = 244,
},
disable_inline_completion = false,
disable_keymaps = false,
-- Suppress inline ghost text whenever nvim-cmp popup is open
condition = function()
local ok, cmp = pcall(require, "cmp")
return ok and cmp.visible()
end,
})
end,
},
-- 2. Configure nvim-cmp (Decoupled from Tab)
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
-- Explicitly unbind Tab in nvim-cmp so Supermaven owns it cleanly
["<Tab>"] = cmp.config.disable,
["<S-Tab>"] = cmp.config.disable,
-- Assign dedicated snippet jumping keys to avoid Tab contention
["<C-l>"] = cmp.mapping(function(fallback)
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<C-h>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}),
})
end,
},
}
Solution 2: Context-Aware Super-Tab Fallback
If muscle memory binds your workflow to a single polymorphic <Tab> that must adaptively handle LSP popups, AI suggestions, snippets, and plain indents, you must disable Supermaven's internal keybindings and route all logic through nvim-cmp's mapping handler.
Configuration Steps
- In
supermaven-nvim, setdisable_keymaps = trueso the plugin does not attach global key listeners. - In
supermaven-nvim, retain the dynamic suppressionconditionso ghost text yields to the menu. - In
nvim-cmp, construct a strict prioritized fallback chain on<Tab>:- If
cmp.visible(), select the next candidate. - If Supermaven has an active preview (
supermaven.has_suggestion()), accept it. - If LuaSnip can expand or jump (
luasnip.expand_or_jumpable()), execute the snippet step. - Fall back to standard editor indentation (
fallback()).
- If
- Map
<C-j>explicitly to Supermaven's word-by-word accept function.
return {
{
"supermaven-inc/supermaven-nvim",
event = "InsertEnter",
config = function()
require("supermaven-nvim").setup({
disable_inline_completion = false,
disable_keymaps = true, -- Disable default key bindings
condition = function()
local ok, cmp = pcall(require, "cmp")
return ok and cmp.visible()
end,
})
-- Manually bind incremental word acceptance
vim.keymap.set("i", "<C-j>", function()
require("supermaven-nvim.completion_preview").on_accept_suggestion_word()
end, { desc = "Supermaven accept word" })
-- Manually bind suggestion dismissal
vim.keymap.set("i", "<C-]>", function()
require("supermaven-nvim.completion_preview").on_dispose_inlay()
end, { desc = "Supermaven clear suggestion" })
end,
},
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping(function(fallback)
local supermaven = require("supermaven-nvim.completion_preview")
if cmp.visible() then
cmp.select_next_item()
elseif supermaven.has_suggestion() then
supermaven.on_accept_suggestion()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
-- Sources and snippet setup...
})
end,
},
}
Solution 3: Integrated cmp Source Mode (Alternative)
For developers who dislike floating ghost text altogether and prefer an IDE-style unified dropdown, you can feed Supermaven directly into nvim-cmp as a completion source.
return {
{
"supermaven-inc/supermaven-nvim",
config = function()
require("supermaven-nvim").setup({
disable_inline_completion = true, -- Turn off virtual ghost text
disable_keymaps = true, -- Let nvim-cmp handle all confirmations
})
end,
},
{
"hrsh7th/nvim-cmp",
dependencies = { "supermaven-inc/supermaven-nvim" },
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, 1, {
name = "supermaven",
group_index = 1,
priority = 1000,
})
end,
},
}
365Finds Trade-Off Note: While this eliminates visual collisions automatically, you will lose multi-line preview formatting and word-by-word streaming acceptance. Treat this strictly as a preference compromise rather than an optimal setup.
Operational Diagnostics and Verification
Once configured, verify your environment with these checks:
- Authentication Check: Run
:SupermavenUseFreeto verify free tier operation or:SupermavenUseProif you maintain an active subscription. - Runtime Status: Run
:SupermavenToggleto ensure the background daemon halts and restarts predictably without throwing Lua errors. - Log Inspection: If ghost text does not render, run
:SupermavenShowLog. Look for communication errors between the local Neovim client and the Supermaven binary daemon. - Collision Test:
- In insert mode, type a variable name with multiple LSP candidates (e.g.,
local str = ""; str.). Confirm that thenvim-cmppopup opens and no gray ghost text renders behind it. - On a new line, start typing a descriptive function (e.g.,
local function calculate_fibonacci(). Confirm that Supermaven's multi-line ghost text appears,<C-j>accepts words incrementally, and<Tab>inserts the full block without cursor jumping.
- In insert mode, type a variable name with multiple LSP candidates (e.g.,