Update .config/nvim/init.lua

Add .config/nvim/lua/plugin/40_ai.lua
This commit is contained in:
Lewis Wynne 2025-11-03 19:54:27 +00:00
parent 97e0d11836
commit 44f54e74e5
2 changed files with 77 additions and 0 deletions

View file

@ -20,6 +20,7 @@
-- ├──── 25_git.lua Gitsigns -- ├──── 25_git.lua Gitsigns
-- ├──── 30_formatting.lua vim-sleuth and conform formatting configs -- ├──── 30_formatting.lua vim-sleuth and conform formatting configs
-- ├──── 35_yanky.lua Yank and Put improvements -- ├──── 35_yanky.lua Yank and Put improvements
-- ├──── 40_ai.lua Github Copilot integration, CodeCompanion,etc.
-- ├ snippets/ Snippets definitions are in here -- ├ snippets/ Snippets definitions are in here
-- ├── package.json Snippet repository metadata -- ├── package.json Snippet repository metadata
-- ├── global.json Global text snippets -- ├── global.json Global text snippets

View file

@ -0,0 +1,76 @@
return {
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
{
"MeanderingProgrammer/render-markdown.nvim",
ft = { "markdown", "codecompanion" },
},
{
"nvim-mini/mini.diff",
config = function()
require("mini.diff").setup({
source = require("mini.diff").gen_source.none(),
})
end,
},
{
"HakonHarnes/img-clip.nvim",
opts = {
filetypes = {
codecompanion = {
prompt_for_file_name = false,
template = "[Image]($FILE_PATH)",
use_absolute_path = true,
},
},
},
},
},
-- stylua: ignore
keys = {
{ "<leader>ac", mode = { "n", "v" }, "<cmd>CodeCompanionChat Toggle<cr>", desc = "toggle chat" },
{ "<leader>ai", mode = { "n", "v" }, "<cmd>CodeCompanionActions<cr>", desc = "actions picker" },
{ "<leader>y", mode = { "v" }, "<cmd>CodeCompanionChat Add<cr>", desc = "put in chat", },
},
-- stylua: unignore
opts = {
strategies = {
chat = {
variables = {
["buffer"] = {
opts = {
default_params = "watch",
},
},
},
slash_commands = {
["buffer"] = {
keymaps = {
modes = {
i = "<c-b>",
n = "<leader>b",
},
},
},
},
},
},
display = {
action_palette = {
width = 85,
height = 10,
prompt = "prompt:",
provider = "fzf_lua",
opts = {
show_default_actions = true,
show_default_prompt_library = true,
title = "action:",
},
},
},
},
},
}