Adding back some blink completion settings. Toggle and ignore on Markdown files.
All checks were successful
Build and Push Docker Image / build-push (push) Successful in 12m36s
All checks were successful
Build and Push Docker Image / build-push (push) Successful in 12m36s
This commit is contained in:
39
nvim/lua/plugins/blink-completion.lua
Normal file
39
nvim/lua/plugins/blink-completion.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
---@param opts blink.cmp.Config
|
||||
opts = function(_, opts)
|
||||
-- Start with completion disabled in the current buffer.
|
||||
-- Remove this line if you want it enabled by default.
|
||||
vim.b.completion = false
|
||||
|
||||
-- Toggle completion per-buffer with <leader>uk
|
||||
Snacks.toggle({
|
||||
name = "Completion",
|
||||
get = function()
|
||||
-- treat anything except explicit false as "on"
|
||||
return vim.b.completion ~= false
|
||||
end,
|
||||
set = function(state)
|
||||
vim.b.completion = state
|
||||
end,
|
||||
}):map("<leader>uk")
|
||||
|
||||
-- Override Blink's global enabled() logic
|
||||
opts.enabled = function()
|
||||
-- 1) Hard-disable completion for markdown buffers
|
||||
if vim.bo.filetype == "markdown" or vim.bo.filetype == "markdown.mdx" then
|
||||
return false
|
||||
end
|
||||
|
||||
-- 2) Keep Blink's default "no completion in prompt buffers"
|
||||
if vim.bo.buftype == "prompt" then
|
||||
return false
|
||||
end
|
||||
|
||||
-- 3) Respect the per-buffer toggle
|
||||
return vim.b.completion ~= false
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user