Path completion not working after slash
Make sure you have done the following
- [x] Updated to the latest version of
blink.cmp - [x] Searched for existing issues and documentation (try
<C-k>on https://cmp.saghen.dev)
Bug Description
path completion not show after input slash,unless input a word after slash
Relevant configuration
local blink = require('blink-cmp')
blink.setup({
cmdline = {
completion = {
menu = {
auto_show = function(ctx)
return vim.fn.getcmdtype() == ':'
end,
},
ghost_text = { enabled = false }
},
keymap = {
["<CR>"] = { "select_and_accept", "fallback" }
}
},
snippets = { preset = 'luasnip' },
fuzzy = {
sorts = {
'exact',
'score',
'sort_text',
},
},
completion = {
list = {
selection = {
-- preselect = true
}
},
accept = {
auto_brackets = {
enabled = false,
},
},
menu = {
border = 'rounded',
draw = {
columns = { { "kind_icon", "label", "label_description", gap = 1 }, { "kind", gap = 1 } },
components = {
kind = {
text = function(ctx)
local len = 10 - string.len(ctx.kind)
local space = string.rep(" ", len)
return ctx.kind .. space .. '[' .. ctx.source_name .. ']'
end
}
},
}
},
documentation = {
window = { border = 'rounded' },
auto_show = true,
auto_show_delay_ms = 0,
},
},
keymap = {
["<CR>"] = {
function(cmp)
local mode = vim.api.nvim_get_mode().mode
if mode == 'c' then
return nil
end
local selected_item = require('blink.cmp.completion.list').get_selected_item()
if cmp.is_visible then
if selected_item ~= nil then
return cmp.accept()
else
return cmp.accept({ index = 1 })
end
end
end,
"fallback"
},
["<Tab>"] = {
function(cmp)
local is_visible = vim.api.nvim_call_function("codeium#GetStatusString", {})
if is_visible ~= '*' then
vim.fn['codeium#Accept']()
else
return cmp.select_next()
end
end,
"snippet_forward",
"fallback",
},
["<S-Tab>"] = {
function(cmp)
return cmp.select_prev()
end,
"snippet_backward",
"fallback",
},
["<C-k>"] = { "show" },
["<C-j>"] = { "hide", "fallback" },
},
sources = {
default = { 'snippets', 'lsp', 'path', 'buffer' },
providers = {
codeium = {
name = "codeium",
module = "blink.compat.source",
},
snippets = {
min_keyword_length = 1,
score_offset = 4,
},
cmdline = {
min_keyword_length = function(ctx)
-- when typing a command, only show when the keyword is 3 characters or longer
if ctx.mode == 'cmdline' and string.find(ctx.line, ' ') == nil then return 3 end
return 0
end
},
lsp = {
min_keyword_length = 0,
score_offset = 3,
name = "LSP",
module = "blink.cmp.sources.lsp",
fallbacks = {},
},
path = {
min_keyword_length = 0,
score_offset = 2,
},
buffer = {
min_keyword_length = 1,
score_offset = 1,
},
},
},
})
neovim version
0.11,4
blink.cmp version
main
Also, Completion is not triggered when typing after a character.
in nvim-cmp
The path completion issue comes from your LSP, not from blink.cmp, as those paths are specific to typescript.
For the second issue, try setting sources.providers.lsp.fallback = {} to always show the buffer completion, and lmk if that solves the issue.
-
Not sure it is LSP's issue,since it working in nvim-cmp
-
sources.providers.lsp.fallback = {} not working, i alrady configure it to {}
What LSP are you using? If it's ts_ls, try vtsls instead as the former has known compatibility issues. I'm not able to reproduce this issue on either LSP though, so please send a repro.lua if the issue still isn't fixed.
For the second issue, that's because nvim-cmp doesn't recognize non-latin alphabets but blink.cmp does. So it's matching on the whole string, not just dev like nvim-cmp.
This might be related, but this one is with dash instead of slash. It only works once I add a space after the dash character and then move back. I'm using vtsls lsp.
https://github.com/user-attachments/assets/af02e3d8-7067-4638-8e31-814e1a985392
-
windwp/nvim-ts-autotagbreaks path completion
{
"windwp/nvim-ts-autotag",
event = "InsertEnter",
config = function(self, opts)
require('nvim-ts-autotag').setup({
opts = {
enable_close_on_slash = true -- this option cause path completion not working
}
})
end
},
- for some reason, I need blink.cmp to detect newly input characters or the entire string., Is there any way?
This might be related, but this one is with dash instead of slash. It only works once I add a space after the dash character and then move back. I'm using vtsls lsp.
Screen.Recording.2025-09-27.at.12.57.05.AM.mov
I see this in non-path TypeScript completions, as well. I'm also using vtsls.
Simple example:
type Test = 'test-one' | 'test-two';
const a: Test = 'test-'
// 👆 completion stops after typing the dash, unless you add a space, then move back and trigger completion again
https://github.com/user-attachments/assets/634c2f3b-1fa4-4a0d-8c50-c72a5b214118