Files
dotfiles-public/private_dot_config/nvim/lua/plugins/blink.lua
T
bcherb2 0aaaf51421 feat: nvim config tracks the live tree
Port the live ~/.config/nvim working tree (bcherb2/nvim master plus its
uncommitted git.lua and minimap.lua edits): adds claudecode, eslint, lsp,
typescript, meow-yarn and refactoring-fix specs, drops the files the live
repo deleted, and takes live for everything else.

Kept from public: lazy.lua with luarocks disabled, the ai_assist cond
guard (nvim-ai-assist is not anonymously clonable, so a fresh box only
gets it from the private clone list), and the scrubbed endpoint comment
in place of live's LAN address.
2026-11-18 01:32:57 -05:00

55 lines
2.4 KiB
Lua

-- Tame blink.cmp completions for prose:
-- * drop the `buffer` (next-word) source everywhere
-- * markdown/md-render buffers use LSP+path only (no snippet callout noise)
-- * disable friendly-snippets' global snippets (datetime/dateMDY/lorem/...)
-- Inline LLM ghost-text (minuet-ai.nvim) was removed; blink is the only completion source.
return {
"saghen/blink.cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
-- Drop the buffer (next-word) source everywhere.
opts.sources.default = vim.tbl_filter(function(source)
return source ~= "buffer"
end, opts.sources.default or { "lsp", "path", "snippets" })
-- Markdown editing (ft=markdown) and md-render's render buffer (ft=md-render):
-- LSP+path only, so callout snippets like !WARNING don't pop up. md-render
-- flips the buffer filetype between these two as you edit, so cover both.
opts.sources.per_filetype = opts.sources.per_filetype or {}
opts.sources.per_filetype.markdown = { "lsp", "path" }
opts.sources.per_filetype["md-render"] = { "lsp", "path" }
-- Kill friendly-snippets' GLOBAL snippets (global.json: datetime, dateMDY,
-- lorem, etc.). These load in every filetype regardless of the per_filetype
-- rules above, which is why they leaked through while editing markdown.
-- Per-language snippets (friendly_snippets) are unaffected.
opts.sources.providers = opts.sources.providers or {}
opts.sources.providers.snippets = opts.sources.providers.snippets or {}
opts.sources.providers.snippets.opts = opts.sources.providers.snippets.opts or {}
opts.sources.providers.snippets.opts.global_snippets = {}
-- Global on/off switch for completion (<leader>uk below). While it's on,
-- blink's own `enabled` check still applies.
local prev = opts.enabled
opts.enabled = function()
if vim.g.thembones_completion == false then return false end
if type(prev) == "function" then return prev() end
return true
end
end,
keys = {
{
"<leader>uk",
function()
vim.g.thembones_completion = vim.g.thembones_completion == false
if not vim.g.thembones_completion then
pcall(function() require("blink.cmp").hide() end)
end
vim.notify("Completion " .. (vim.g.thembones_completion and "on" or "off"))
end,
desc = "Toggle Completion (global)",
},
},
}