mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
feat: codecompanion.nvim
This commit is contained in:
parent
55bade6fb7
commit
b4404d2c1f
6 changed files with 69 additions and 46 deletions
|
|
@ -2,10 +2,19 @@ return {
|
|||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
keys = {
|
||||
{
|
||||
'M-\\',
|
||||
'<cmd>Copilot panel<CR>',
|
||||
noremap = true,
|
||||
desc = 'Copilot panel'
|
||||
}
|
||||
},
|
||||
opts = {
|
||||
panel = { enabled = false },
|
||||
panel = { enabled = true, keymap = { accept = "ga" } },
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<M-]>",
|
||||
next = "<M-[>",
|
||||
|
|
@ -43,36 +52,50 @@ return {
|
|||
}
|
||||
},
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
"olimorris/codecompanion.nvim",
|
||||
cmd = "Copilot",
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"zbirenbaum/copilot.lua",
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
provider = "copilot",
|
||||
-- auto_suggestions_provider = "copilot",
|
||||
behavior = {
|
||||
auto_suggestions = false, -- TODO
|
||||
adapters = {
|
||||
copilot = function()
|
||||
return require("codecompanion.adapters").extend("copilot", {
|
||||
name = "copilot-claude-3.5-sonnet",
|
||||
schema = { model = "claude-3.5-sonnet", },
|
||||
})
|
||||
end
|
||||
},
|
||||
file_selector = {
|
||||
provider = "native", -- TODO snacks once it's ready
|
||||
strategies = {
|
||||
chat = { adapter = "copilot-claude-3.5-sonnet", },
|
||||
inline = { adapter = "copilot-claude-3.5-sonnet", },
|
||||
},
|
||||
windows = {
|
||||
width = 50,
|
||||
ask = {
|
||||
floating = true
|
||||
}
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_user_command('CC', ':CodeCompanion', {})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>ac',
|
||||
'<cmd>CodeCompanionChat Toggle<CR>',
|
||||
noremap = true,
|
||||
desc = 'Copilot chat toggle'
|
||||
},
|
||||
{
|
||||
'<leader>as',
|
||||
'<cmd>CodeCompanionChat Add<CR>',
|
||||
noremap = true,
|
||||
desc = 'Copilot chat add selection'
|
||||
},
|
||||
{
|
||||
'<leader>aa',
|
||||
'<cmd>CodeCompanionActions<CR>',
|
||||
noremap = true,
|
||||
desc = 'Copilot inline'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ return {
|
|||
'saghen/blink.cmp',
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "yetone/avante.nvim", lazy = true },
|
||||
'saghen/blink.compat',
|
||||
'rafamadriz/friendly-snippets',
|
||||
'giuxtaposition/blink-cmp-copilot',
|
||||
|
|
@ -34,8 +33,7 @@ return {
|
|||
"snippets",
|
||||
"buffer",
|
||||
"ripgrep",
|
||||
"avante_commands",
|
||||
"avante_mentions",
|
||||
"copilot"
|
||||
},
|
||||
providers = {
|
||||
ripgrep = {
|
||||
|
|
@ -43,18 +41,12 @@ return {
|
|||
name = "rg",
|
||||
score_offset = -10,
|
||||
},
|
||||
avante_commands = {
|
||||
name = "avante_commands",
|
||||
module = "blink.compat.source",
|
||||
score_offset = 90,
|
||||
opts = {},
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-cmp-copilot",
|
||||
score_offset = 100,
|
||||
async = true,
|
||||
},
|
||||
avante_mentions = {
|
||||
name = "avante_mentions",
|
||||
module = "blink.compat.source",
|
||||
score_offset = 1000,
|
||||
opts = {},
|
||||
}
|
||||
}
|
||||
},
|
||||
keymap = {
|
||||
|
|
@ -77,6 +69,8 @@ return {
|
|||
}
|
||||
},
|
||||
menu = {
|
||||
-- auto show in cmdline
|
||||
auto_show = true,
|
||||
draw = {
|
||||
treesitter = { "lsp" },
|
||||
columns = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ return {
|
|||
{
|
||||
'<leader>de',
|
||||
'<cmd>Trouble diagnostics toggle focus=true<CR>',
|
||||
{ noremap = true, desc = 'Trouble diagnostics' }
|
||||
noremap = true,
|
||||
desc = 'Trouble diagnostics'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -164,10 +164,15 @@ return {
|
|||
ring = {
|
||||
storage = "memory",
|
||||
},
|
||||
picker = {
|
||||
select = {
|
||||
action = require('yanky.picker').actions.set_register("+")
|
||||
}
|
||||
}
|
||||
},
|
||||
keys = {
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" } },
|
||||
{ "<leader>fp", "<cmd>YankyRingHistory<cr>", { mode = { "n", "x" }, noremap = true, silent = true, desc = 'Pick history (yanky.nvim)' } }
|
||||
{ "<leader>fp", "<cmd>YankyRingHistory<cr>", mode = { "n", "x" }, noremap = true, silent = true, desc = 'Pick history (yanky.nvim)' }
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue