update codecompanion fidget spinner
This commit is contained in:
parent
e6e69a5d7c
commit
ef124ea808
@ -2,7 +2,7 @@
|
|||||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||||
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
|
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
|
||||||
"auto-format.nvim": { "branch": "main", "commit": "1e3c069753d4b0960b351292c1a01af1b122907c" },
|
"auto-format.nvim": { "branch": "main", "commit": "1e3c069753d4b0960b351292c1a01af1b122907c" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "cc2f10e9d8b6420324d4743a4d9a428de427e2cf" },
|
"blink.cmp": { "branch": "main", "commit": "93052a80660d741a051d43dc487c8bf7a2530b11" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
"catppuccin": { "branch": "main", "commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" },
|
"catppuccin": { "branch": "main", "commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" },
|
||||||
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
|
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
|
||||||
@ -11,7 +11,7 @@
|
|||||||
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
|
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
|
||||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"codecompanion.nvim": { "branch": "main", "commit": "f1f05fa75dcb6016b2f2af121f1558ebcaf35ef9" },
|
"codecompanion.nvim": { "branch": "main", "commit": "0ec5921712a426607be0c3c9f0a54b2c86467d4f" },
|
||||||
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
|
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
|
||||||
"copilot-lualine": { "branch": "main", "commit": "dc4b8ed0f75bc2557b3158c526624bf04ad233ea" },
|
"copilot-lualine": { "branch": "main", "commit": "dc4b8ed0f75bc2557b3158c526624bf04ad233ea" },
|
||||||
"copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" },
|
"copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" },
|
||||||
@ -19,7 +19,7 @@
|
|||||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "8b00147519d6f8353867d5d0b55f587306b0cfb6" },
|
"gitsigns.nvim": { "branch": "main", "commit": "8b00147519d6f8353867d5d0b55f587306b0cfb6" },
|
||||||
"goto-preview": { "branch": "main", "commit": "4972fcd01c568c2ae981f3f48182e7832ed544ec" },
|
"goto-preview": { "branch": "main", "commit": "4751e70a6ebce4fb78327b097cb8fdff55f38f3a" },
|
||||||
"image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
|
"image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" },
|
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" },
|
||||||
@ -39,7 +39,7 @@
|
|||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" },
|
"nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "38e46a6d7ade5c8718f77b2b9fd98a0f7ab32c1e" },
|
"nvim-treesitter": { "branch": "master", "commit": "2cade9e3d105732b794bc37e7cb2dc53b1cf99dc" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
|
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
|
@ -6,6 +6,26 @@ return {
|
|||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
log_level = "DEBUG",
|
||||||
|
adapters = {
|
||||||
|
copilot = function()
|
||||||
|
return require("codecompanion.adapters").extend("copilot", {
|
||||||
|
schema = {
|
||||||
|
model = {
|
||||||
|
default = "o3-mini-2025-01-31",
|
||||||
|
choices = {
|
||||||
|
["o3-mini-2025-01-31"] = { opts = { can_reason = true } },
|
||||||
|
["o1-2024-12-17"] = { opts = { can_reason = true } },
|
||||||
|
["o1-mini-2024-09-12"] = { opts = { can_reason = true } },
|
||||||
|
"claude-3.5-sonnet",
|
||||||
|
"gpt-4o-2024-08-06",
|
||||||
|
"gemini-2.0-flash-001",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
strategies = {
|
strategies = {
|
||||||
chat = {
|
chat = {
|
||||||
adapter = "copilot",
|
adapter = "copilot",
|
||||||
@ -16,13 +36,20 @@ return {
|
|||||||
},
|
},
|
||||||
display = {
|
display = {
|
||||||
action_palette = {
|
action_palette = {
|
||||||
provider = "default",
|
provider = "telescope",
|
||||||
width = 150,
|
width = 75,
|
||||||
heigth = 85,
|
heigth = 45,
|
||||||
},
|
},
|
||||||
chat = {
|
chat = {
|
||||||
layout = "vertical",
|
layout = "vertical",
|
||||||
border = "single",
|
border = "single",
|
||||||
|
intro_message = "Welcome to CodeCompanion ✨! Press ? for options",
|
||||||
|
show_header_separator = false, -- Show header separators in the chat buffer? Set this to false if you're using an external markdown formatting plugin
|
||||||
|
separator = "─", -- The separator between the different messages in the chat buffer
|
||||||
|
show_references = true, -- Show references (from slash commands and variables) in the chat buffer?
|
||||||
|
show_settings = true, -- Show LLM settings at the top of the chat buffer?
|
||||||
|
show_token_count = true, -- Show the token count for each response?
|
||||||
|
start_in_insert_mode = false, -- Open the chat buffer in insert mode?
|
||||||
},
|
},
|
||||||
diff = {
|
diff = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
local progress = require("fidget.progress")
|
local notify = require("notify")
|
||||||
|
local spinner_frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M:init()
|
function M:init()
|
||||||
@ -40,31 +40,46 @@ function M:pop_progress_handle(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M:create_progress_handle(request)
|
function M:create_progress_handle(request)
|
||||||
return progress.handle.create({
|
local title = " Requesting assistance (" .. request.data.strategy .. ")"
|
||||||
title = " Requesting assistance (" .. request.data.strategy .. ")",
|
local idx = 1
|
||||||
message = "In progress...",
|
local notification_id = notify(spinner_frames[idx] .. " In progress...", "info", { title = title, timeout = false })
|
||||||
lsp_client = {
|
local handle = { notification_id = notification_id, title = title }
|
||||||
name = M:llm_role_title(request.data.adapter),
|
local timer = vim.loop.new_timer()
|
||||||
},
|
if timer == nil then
|
||||||
})
|
return
|
||||||
end
|
|
||||||
|
|
||||||
function M:llm_role_title(adapter)
|
|
||||||
local parts = {}
|
|
||||||
table.insert(parts, adapter.formatted_name)
|
|
||||||
if adapter.model and adapter.model ~= "" then
|
|
||||||
table.insert(parts, "(" .. adapter.model .. ")")
|
|
||||||
end
|
end
|
||||||
return table.concat(parts, " ")
|
timer:start(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
vim.schedule_wrap(function()
|
||||||
|
idx = idx % #spinner_frames + 1
|
||||||
|
local new_id = notify(
|
||||||
|
spinner_frames[idx] .. " In progress...",
|
||||||
|
"info",
|
||||||
|
{ replace = handle.notification_id, title = title, timeout = false }
|
||||||
|
)
|
||||||
|
handle.notification_id = new_id
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
handle.timer = timer
|
||||||
|
handle.finish = function()
|
||||||
|
if handle.timer then
|
||||||
|
handle.timer:stop()
|
||||||
|
handle.timer:close()
|
||||||
|
handle.timer = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return handle
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:report_exit_status(handle, request)
|
function M:report_exit_status(handle, request)
|
||||||
|
local title = handle.title or (" Requesting assistance (" .. request.data.strategy .. ")")
|
||||||
if request.data.status == "success" then
|
if request.data.status == "success" then
|
||||||
handle.message = "Completed"
|
notify("Completed", "info", { replace = handle.notification_id, title = title })
|
||||||
elseif request.data.status == "error" then
|
elseif request.data.status == "error" then
|
||||||
handle.message = " Error"
|
notify(" Error", "error", { replace = handle.notification_id, title = title })
|
||||||
else
|
else
|
||||||
handle.message = " Cancelled"
|
notify(" Cancelled", "warn", { replace = handle.notification_id, title = title })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,263 +1,263 @@
|
|||||||
return {
|
return {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
"hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-cmdline",
|
||||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||||
"hrsh7th/cmp-nvim-lsp-document-symbol",
|
"hrsh7th/cmp-nvim-lsp-document-symbol",
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
-- "hrsh7th/cmp-nvim-lsp",
|
||||||
-- "hrsh7th/cmp-path",
|
-- "hrsh7th/cmp-path",
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
"Jezda1337/nvim-html-css",
|
"Jezda1337/nvim-html-css",
|
||||||
"https://codeberg.org/FelipeLema/cmp-async-path",
|
"https://codeberg.org/FelipeLema/cmp-async-path",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local lspkind = require("lspkind")
|
local lspkind = require("lspkind")
|
||||||
-- luasnip setup
|
-- luasnip setup
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
|
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
|
||||||
end
|
end
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
lspkind.init({ symbol_map = { Copilot = "" } })
|
lspkind.init({ symbol_map = { Copilot = "" } })
|
||||||
|
|
||||||
cmp.setup.cmdline("/", {
|
cmp.setup.cmdline("/", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp_document_symbol" },
|
{ name = "nvim_lsp_document_symbol" },
|
||||||
}, {
|
}, {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
cmp.setup.cmdline(":", {
|
cmp.setup.cmdline(":", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({ { name = "path" } }, {
|
sources = cmp.config.sources({ { name = "path" } }, {
|
||||||
{ name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
{ name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
||||||
}),
|
}),
|
||||||
matching = { disallow_symbol_nonprefix_matching = false },
|
matching = { disallow_symbol_nonprefix_matching = false },
|
||||||
})
|
})
|
||||||
|
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
||||||
require('cmp').setup({
|
require("cmp").setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-p>"] = cmp.mapping(function(fallback)
|
["<C-p>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<C-n>"] = cmp.mapping(function(fallback)
|
["<C-n>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = false,
|
select = false,
|
||||||
}),
|
}),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() and has_words_before() then
|
if cmp.visible() and has_words_before() then
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
elseif luasnip.locally_jumpable(1) then
|
elseif luasnip.locally_jumpable(1) then
|
||||||
luasnip.jump(1)
|
luasnip.jump(1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.locally_jumpable(-1) then
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
col_offset = 0,
|
col_offset = 0,
|
||||||
side_padding = 0,
|
side_padding = 0,
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
borderchars = {
|
borderchars = {
|
||||||
"─",
|
"─",
|
||||||
"│",
|
"│",
|
||||||
"─",
|
"─",
|
||||||
"│",
|
"│",
|
||||||
"╭",
|
"╭",
|
||||||
"╮",
|
"╮",
|
||||||
"╯",
|
"╯",
|
||||||
"╰",
|
"╰",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
borderchars = {
|
borderchars = {
|
||||||
"─",
|
"─",
|
||||||
"│",
|
"│",
|
||||||
"─",
|
"─",
|
||||||
"│",
|
"│",
|
||||||
"╭",
|
"╭",
|
||||||
"╮",
|
"╮",
|
||||||
"╯",
|
"╯",
|
||||||
"╰",
|
"╰",
|
||||||
},
|
},
|
||||||
-- padding = 15,
|
-- padding = 15,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
||||||
-- mode = 'symbol_text',
|
-- mode = 'symbol_text',
|
||||||
fields = { "kind", "abbr", "menu" },
|
fields = { "kind", "abbr", "menu" },
|
||||||
expandable_indicator = true,
|
expandable_indicator = true,
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
local kind = require("lspkind").cmp_format({
|
local kind = require("lspkind").cmp_format({
|
||||||
mode = "symbol_text",
|
mode = "symbol_text",
|
||||||
-- mode = "symbol",
|
-- mode = "symbol",
|
||||||
maxwidth = 75,
|
maxwidth = 75,
|
||||||
symbol_map = {
|
symbol_map = {
|
||||||
Copilot = " ",
|
Copilot = " ",
|
||||||
Text = " ",
|
Text = " ",
|
||||||
Method = " ",
|
Method = " ",
|
||||||
Function = " ",
|
Function = " ",
|
||||||
Constructor = " ",
|
Constructor = " ",
|
||||||
Field = " ",
|
Field = " ",
|
||||||
Variable = " ",
|
Variable = " ",
|
||||||
Class = " ",
|
Class = " ",
|
||||||
Interface = " ",
|
Interface = " ",
|
||||||
Module = " ",
|
Module = " ",
|
||||||
Property = " ",
|
Property = " ",
|
||||||
Unit = " ",
|
Unit = " ",
|
||||||
Value = " ",
|
Value = " ",
|
||||||
Enum = " ",
|
Enum = " ",
|
||||||
Keyword = " ",
|
Keyword = " ",
|
||||||
Snippet = " ",
|
Snippet = " ",
|
||||||
Color = " ",
|
Color = " ",
|
||||||
File = " ",
|
File = " ",
|
||||||
Reference = " ",
|
Reference = " ",
|
||||||
Folder = " ",
|
Folder = " ",
|
||||||
EnumMember = " ",
|
EnumMember = " ",
|
||||||
Constant = " ",
|
Constant = " ",
|
||||||
Struct = " ",
|
Struct = " ",
|
||||||
Event = " ",
|
Event = " ",
|
||||||
Operator = " ",
|
Operator = " ",
|
||||||
TypeParameter = " ",
|
TypeParameter = " ",
|
||||||
},
|
},
|
||||||
})(entry, vim_item)
|
})(entry, vim_item)
|
||||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
kind.kind = " " .. strings[1] .. " "
|
kind.kind = " " .. strings[1] .. " "
|
||||||
kind.menu = " (" .. strings[2] .. ")"
|
kind.menu = " (" .. strings[2] .. ")"
|
||||||
|
|
||||||
return kind
|
return kind
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp_signature_help", group_index = 0 },
|
{ name = "nvim_lsp_signature_help", group_index = 0 },
|
||||||
{ name = "lazydev", group_index = 0 },
|
{ name = "lazydev", group_index = 0 },
|
||||||
{ name = "nvim_lsp", group_index = 1 },
|
{ name = "nvim_lsp", group_index = 1 },
|
||||||
{ name = "copilot", group_index = 1 },
|
{ name = "copilot", group_index = 1 },
|
||||||
{ name = "codecompanion", group_index = 1 },
|
{ name = "codecompanion", group_index = 2 },
|
||||||
{ name = "async_path", group_index = 2 },
|
{ name = "async_path", group_index = 2 },
|
||||||
-- { name = "path", group_index = 2 },
|
-- { name = "path", group_index = 2 },
|
||||||
-- { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
-- { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
||||||
{ name = "nvim_lsp_document_symbol", group_index = 2 },
|
{ name = "nvim_lsp_document_symbol", group_index = 2 },
|
||||||
{ name = "luasnip", group_index = 2 }, -- For luasnip users.
|
{ name = "luasnip", group_index = 2 }, -- For luasnip users.
|
||||||
{ name = "render-markdown", group_index = 2 },
|
{ name = "render-markdown", group_index = 2 },
|
||||||
{
|
{
|
||||||
name = "html-css",
|
name = "html-css",
|
||||||
group_indx = 2,
|
group_indx = 2,
|
||||||
option = {
|
option = {
|
||||||
enable_on = { "html", "jsx", "tsx", "typescript", "typescriptreact" }, -- html is enabled by default
|
enable_on = { "html", "jsx", "tsx", "typescript", "typescriptreact" }, -- html is enabled by default
|
||||||
notify = false,
|
notify = false,
|
||||||
documentation = {
|
documentation = {
|
||||||
auto_show = true, -- show documentation on select
|
auto_show = true, -- show documentation on select
|
||||||
},
|
},
|
||||||
-- add any external scss like one below
|
-- add any external scss like one below
|
||||||
style_sheets = {
|
style_sheets = {
|
||||||
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css",
|
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css",
|
||||||
"https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css",
|
"https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "buffer",
|
name = "buffer",
|
||||||
option = {
|
option = {
|
||||||
get_bufnrs = function()
|
get_bufnrs = function()
|
||||||
local bufs = {}
|
local bufs = {}
|
||||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
bufs[vim.api.nvim_win_get_buf(win)] = true
|
bufs[vim.api.nvim_win_get_buf(win)] = true
|
||||||
end
|
end
|
||||||
return vim.tbl_keys(bufs)
|
return vim.tbl_keys(bufs)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
-- { name = 'snippy' }, -- For snippy users.
|
||||||
}, { { name = "buffer" } }),
|
}, { { name = "buffer" } }),
|
||||||
sorting = {
|
sorting = {
|
||||||
priority_weight = 2,
|
priority_weight = 2,
|
||||||
comparators = {
|
comparators = {
|
||||||
require("copilot_cmp.comparators").prioritize,
|
require("copilot_cmp.comparators").prioritize,
|
||||||
cmp.config.compare.offset,
|
cmp.config.compare.offset,
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact,
|
||||||
require("copilot_cmp.comparators").score,
|
require("copilot_cmp.comparators").score,
|
||||||
require("copilot_cmp.comparators").recently_used,
|
require("copilot_cmp.comparators").recently_used,
|
||||||
cmp.config.compare.locality,
|
cmp.config.compare.locality,
|
||||||
require("copilot_cmp.comparators").kind,
|
require("copilot_cmp.comparators").kind,
|
||||||
require("copilot_cmp.comparators").sort_text,
|
require("copilot_cmp.comparators").sort_text,
|
||||||
require("copilot_cmp.comparators").length,
|
require("copilot_cmp.comparators").length,
|
||||||
require("copilot_cmp.comparators").order,
|
require("copilot_cmp.comparators").order,
|
||||||
|
|
||||||
-- Below is the default comparitor list and order for nvim-cmp
|
-- Below is the default comparitor list and order for nvim-cmp
|
||||||
cmp.config.compare.offset,
|
cmp.config.compare.offset,
|
||||||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact,
|
||||||
cmp.config.compare.score,
|
cmp.config.compare.score,
|
||||||
cmp.config.compare.recently_used,
|
cmp.config.compare.recently_used,
|
||||||
cmp.config.compare.locality,
|
cmp.config.compare.locality,
|
||||||
cmp.config.compare.kind,
|
cmp.config.compare.kind,
|
||||||
cmp.config.compare.sort_text,
|
cmp.config.compare.sort_text,
|
||||||
cmp.config.compare.length,
|
cmp.config.compare.length,
|
||||||
cmp.config.compare.order,
|
cmp.config.compare.order,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ return {
|
|||||||
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
|
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
|
||||||
-- file it will be ignored but you can customize this behavior here.
|
-- file it will be ignored but you can customize this behavior here.
|
||||||
---@param img string
|
---@param img string
|
||||||
follow_img_func = function(img)
|
follow_img_func = function(url)
|
||||||
-- vim.fn.jobstart({ "qlmanage", "-p", img }) -- Mac OS quick look preview
|
-- vim.fn.jobstart({ "qlmanage", "-p", img }) -- Mac OS quick look preview
|
||||||
vim.fn.jobstart({ "xdg-open", url }) -- linux
|
vim.fn.jobstart({ "xdg-open", url }) -- linux
|
||||||
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
|
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
|
||||||
|
Loading…
x
Reference in New Issue
Block a user