bs blink/cmp
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
local use_google = require("utils").use_google
|
||||
local flags = require("utils").flags
|
||||
|
||||
local kind_icons = {
|
||||
-- LLM Provider icons
|
||||
claude = "",
|
||||
@ -17,6 +18,7 @@ local kind_icons = {
|
||||
return {
|
||||
{
|
||||
"milanglacier/minuet-ai.nvim",
|
||||
cond = not use_google(),
|
||||
config = function()
|
||||
require("minuet").setup({
|
||||
provider = "gemini",
|
||||
@ -66,8 +68,8 @@ return {
|
||||
version = "*",
|
||||
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
|
||||
lazy = true,
|
||||
cond = flags.blink,
|
||||
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
|
||||
cond = flags.blink,
|
||||
opts = {
|
||||
impersonate_nvim_cmp = true,
|
||||
debug = true,
|
||||
@ -88,6 +90,7 @@ return {
|
||||
version = "v0.*", -- use a release tag to download pre-built binaries
|
||||
-- build = 'cargo build --release',
|
||||
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
@ -125,7 +128,6 @@ return {
|
||||
}
|
||||
if use_google() then
|
||||
table.insert(providerToEnable, "nvim_ciderlsp")
|
||||
table.insert(providerToEnable, "buganizer")
|
||||
else
|
||||
table.insert(providerToEnable, "minuet")
|
||||
end
|
||||
@ -178,10 +180,6 @@ return {
|
||||
module = "blink.compat.source",
|
||||
score_offset = 100,
|
||||
},
|
||||
buganizer = {
|
||||
name = "nvim_buganizer",
|
||||
module = "blink.compat.source",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- experimental signature help support
|
||||
|
@ -222,7 +222,7 @@ return {
|
||||
},
|
||||
cmd = { "ImpSuggest", "ImpFirst" },
|
||||
keys = {
|
||||
{ "<leader>i", ":ImpSuggest <C-r><C-w><cr>" },
|
||||
{ "<leader>I", ":ImpSuggest <C-r><C-w><cr>" },
|
||||
},
|
||||
}),
|
||||
{
|
||||
|
@ -1,6 +1,16 @@
|
||||
local use_google = require("utils").use_google
|
||||
local flags = require("utils").flags
|
||||
|
||||
local function add_import()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "quickfix.addImports" },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
{
|
||||
"kosayoda/nvim-lightbulb",
|
||||
@ -69,6 +79,7 @@ return {
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>F", ":lua vim.lsp.buf.format()<CR>" },
|
||||
{ "<leader>i", add_import },
|
||||
{ "<leader>rn", ":lua vim.lsp.buf.rename()<CR>" },
|
||||
{ "L", ":lua vim.lsp.buf.hover()<CR>" },
|
||||
{ "gr", ":Telescope lsp_references<CR>" },
|
||||
|
@ -40,48 +40,6 @@ function M.file_exists(name)
|
||||
end
|
||||
end
|
||||
|
||||
function M.dump(o)
|
||||
if type(o) == "table" then
|
||||
local s = "{ "
|
||||
for k, v in pairs(o) do
|
||||
if type(k) ~= "number" then
|
||||
k = '"' .. k .. '"'
|
||||
end
|
||||
s = s .. "[" .. k .. "] = " .. M.dump(v) .. ","
|
||||
end
|
||||
return s .. "} "
|
||||
else
|
||||
return tostring(o)
|
||||
end
|
||||
end
|
||||
|
||||
function M.tprint(tbl, indent)
|
||||
if not indent then
|
||||
indent = 0
|
||||
end
|
||||
local toprint = string.rep(" ", indent) .. "{\r\n"
|
||||
indent = indent + 2
|
||||
for k, v in pairs(tbl) do
|
||||
toprint = toprint .. string.rep(" ", indent)
|
||||
if type(k) == "number" then
|
||||
toprint = toprint .. "[" .. k .. "] = "
|
||||
elseif type(k) == "string" then
|
||||
toprint = toprint .. k .. "= "
|
||||
end
|
||||
if type(v) == "number" then
|
||||
toprint = toprint .. v .. ",\r\n"
|
||||
elseif type(v) == "string" then
|
||||
toprint = toprint .. '"' .. v .. '",\r\n'
|
||||
elseif type(v) == "table" then
|
||||
toprint = toprint .. M.tprint(v, indent + 2) .. ",\r\n"
|
||||
else
|
||||
toprint = toprint .. '"' .. tostring(v) .. '",\r\n'
|
||||
end
|
||||
end
|
||||
toprint = toprint .. string.rep(" ", indent - 2) .. "}"
|
||||
return toprint
|
||||
end
|
||||
|
||||
function M.log(message)
|
||||
local log_file_path = vim.fn.expand("$HOME/nvim.log")
|
||||
local log_file = io.open(log_file_path, "a")
|
||||
@ -97,4 +55,6 @@ function M.TableConcat(t1, t2)
|
||||
return t1
|
||||
end
|
||||
|
||||
M.flags.blink = not M.use_google()
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user