diff --git a/lua/keymap.lua b/lua/keymap.lua index 68356f8..49dacae 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -124,8 +124,8 @@ vim.api.nvim_create_autocmd('BufEnter', { }) -- AI mappings -vim.keymap.set('v', 'ae', 'CodeCompanion', { desc = 'Edit selection with AI' }) -vim.keymap.set('n', 'ac', 'CodeCompanionCmd', { desc = 'Run Neovim commands with AI' }) +-- vim.keymap.set('v', 'ae', 'CodeCompanion', { desc = 'Edit selection with AI' }) +-- vim.keymap.set('n', 'ac', 'CodeCompanionCmd', { desc = 'Run Neovim commands with AI' }) vim.api.nvim_create_autocmd('FileType', { pattern = 'codecompanion', callback = function() diff --git a/lua/plugins/aider.lua b/lua/plugins/aider.lua new file mode 100644 index 0000000..2c6ff4b --- /dev/null +++ b/lua/plugins/aider.lua @@ -0,0 +1,54 @@ +return { + 'GeorgesAlkhouri/nvim-aider', + cmd = 'Aider', + keys = { + { 'a/', 'Aider toggle', desc = 'Toggle Aider' }, + { 'as', 'Aider send', desc = 'Send to Aider', mode = { 'n', 'v' } }, + { 'ac', 'Aider command', desc = 'Aider Commands' }, + { 'ab', 'Aider buffer', desc = 'Send Buffer' }, + { 'a+', 'Aider add', desc = 'Add File' }, + { 'a-', 'Aider drop', desc = 'Drop File' }, + { 'ar', 'Aider add readonly', desc = 'Add Read-Only' }, + { 'aR', 'Aider reset', desc = 'Reset Session' }, + -- Example nvim-tree.lua integration if needed + { 'a+', 'AiderTreeAddFile', desc = 'Add File from Tree to Aider', ft = 'NvimTree' }, + { 'a-', 'AiderTreeDropFile', desc = 'Drop File from Tree from Aider', ft = 'NvimTree' }, + }, + dependencies = { + 'folke/snacks.nvim', + --- The below dependencies are optional + 'catppuccin/nvim', + 'nvim-tree/nvim-tree.lua', + --- Neo-tree integration + { + 'nvim-neo-tree/neo-tree.nvim', + opts = function(_, opts) + -- Example mapping configuration (already set by default) + -- opts.window = { + -- mappings = { + -- ["+"] = { "nvim_aider_add", desc = "add to aider" }, + -- ["-"] = { "nvim_aider_drop", desc = "drop from aider" } + -- ["="] = { "nvim_aider_add_read_only", desc = "add read-only to aider" } + -- } + -- } + require('nvim_aider.neo_tree').setup(opts) + end, + }, + }, + config = function() + require('nvim_aider').setup({ + aider_cmd = 'aider', + args = { + '--config=$HOME/.config/aider/aider.yaml', + '--no-auto-commits', + '--copy-paste', + }, + auto_reload = true, + win = { + wo = { winbar = 'Aider' }, + style = 'nvim_aider', + position = 'bottom', + }, + }) + end, +}