33 lines
703 B
Lua
33 lines
703 B
Lua
return {
|
|
{
|
|
"olimorris/codecompanion.nvim",
|
|
dependencies = {
|
|
"nvim-lua/plenary.nvim",
|
|
"nvim-treesitter/nvim-treesitter",
|
|
},
|
|
opts = {},
|
|
keys = {
|
|
{ "<leader>aa", "<cmd>CodeCompanionChat<cr>", mode = { "n", "v" }, desc = "Toggle Chat" },
|
|
{
|
|
"<leader>ap",
|
|
function()
|
|
local mode = vim.api.nvim_get_mode().mode
|
|
vim.ui.input({ prompt = "AI Prompt: " }, function(input)
|
|
if not input or input == "" then
|
|
return
|
|
end
|
|
|
|
if mode:match("[vV]") then
|
|
vim.cmd("'<,'>CodeCompanion " .. input)
|
|
else
|
|
vim.cmd("CodeCompanion #{buffer} " .. input)
|
|
end
|
|
end)
|
|
end,
|
|
mode = { "n", "v" },
|
|
desc = "AI Prompt",
|
|
},
|
|
},
|
|
},
|
|
}
|