mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-13 19:04:36 +02:00
Merge branch 'main' into patch-2
This commit is contained in:
commit
7158a13570
2 changed files with 16 additions and 32 deletions
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim Last change: 2025 February 22
|
*LazyVim.txt* For Neovim Last change: 2025 March 01
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
@ -1,28 +1,3 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
---@param kind string
|
|
||||||
function M.pick(kind)
|
|
||||||
return function()
|
|
||||||
local actions = require("CopilotChat.actions")
|
|
||||||
local items = actions[kind .. "_actions"]()
|
|
||||||
if not items then
|
|
||||||
LazyVim.warn("No " .. kind .. " found on the current line")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local map = {
|
|
||||||
telescope = "telescope",
|
|
||||||
fzf = "fzflua",
|
|
||||||
snacks = "snacks",
|
|
||||||
}
|
|
||||||
for _, def in pairs(LazyVim.config.get_defaults()) do
|
|
||||||
if def.enabled and map[def.name] then
|
|
||||||
return require("CopilotChat.integrations." .. map[def.name]).pick(items)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Snacks.notify.error("No picker found")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"CopilotC-Nvim/CopilotChat.nvim",
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
|
@ -62,16 +37,25 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>aq",
|
"<leader>aq",
|
||||||
function()
|
function()
|
||||||
local input = vim.fn.input("Quick Chat: ")
|
vim.ui.input({
|
||||||
if input ~= "" then
|
prompt = "Quick Chat: ",
|
||||||
require("CopilotChat").ask(input)
|
}, function(input)
|
||||||
end
|
if input ~= "" then
|
||||||
|
require("CopilotChat").ask(input)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
desc = "Quick Chat (CopilotChat)",
|
desc = "Quick Chat (CopilotChat)",
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
},
|
},
|
||||||
-- Show prompts actions with telescope
|
{
|
||||||
{ "<leader>ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } },
|
"<leader>ap",
|
||||||
|
function()
|
||||||
|
require("CopilotChat").select_prompt()
|
||||||
|
end,
|
||||||
|
desc = "Prompt Actions (CopilotChat)",
|
||||||
|
mode = { "n", "v" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local chat = require("CopilotChat")
|
local chat = require("CopilotChat")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue