diff --git a/lua/plugins/aider.lua b/lua/plugins/aider.lua index 32b0761..ddf086d 100644 --- a/lua/plugins/aider.lua +++ b/lua/plugins/aider.lua @@ -1,5 +1,11 @@ require('helpers').edit_cf('pa', '/lua/plugins/aider.lua') +local change_model_function = function(model) + return function() + require('nvim_aider').api.send_command('/model', model) + end +end + return { 'GeorgesAlkhouri/nvim-aider', cmd = 'Aider', @@ -15,71 +21,10 @@ return { -- 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' }, - -- Open aider with gpt-4.1 as the main model - -- { - -- 'a?', - -- function() - -- require('nvim_aider').setup { - -- aider_cmd = 'aider', - -- args = { - -- '--config=$HOME/.config/aider/aider.yaml', - -- '--env-file=$(pwd)/.aider.env', - -- '--model=gpt-4.1', - -- }, - -- auto_reload = true, - -- win = { - -- wo = { winbar = 'Aider (GPT-4.1)' }, - -- style = 'nvim_aider', - -- position = 'bottom', - -- }, - -- } - -- vim.cmd 'Aider toggle' - -- end, - -- desc = 'Open Aider with GPT-4.1', - -- }, - -- { - -- 'a>', - -- function() - -- require('nvim_aider').setup { - -- aider_cmd = 'aider', - -- args = { - -- '--config=$HOME/.config/aider/aider.yaml', - -- '--env-file=$(pwd)/.aider.env', - -- '--model=openai/gemini-2.5-pro', - -- '--architect', - -- }, - -- auto_reload = true, - -- win = { - -- wo = { winbar = 'Aider (Gemini-2.5-Pro)' }, - -- style = 'nvim_aider', - -- position = 'bottom', - -- }, - -- } - -- vim.cmd 'Aider toggle' - -- end, - -- desc = 'Open Aider with Gemini 2.5 Pro', - -- }, - -- { - -- 'a4', - -- function() - -- require('nvim_aider').api.send_command('/model', 'gpt-4.1') - -- end, - -- desc = 'Switch aider model to GPT-4.1', - -- }, - -- { - -- 'ao', - -- function() - -- require('nvim_aider').api.send_command('/model', 'o4-mini') - -- end, - -- desc = 'Switch aider model to o4-mini', - -- }, - -- { - -- 'ag', - -- function() - -- require('nvim_aider').api.send_command('/model', 'openai/gemini-2.5-pro') - -- end, - -- desc = 'Switch aider model to Gemini 2.5 Pro', - -- }, + { 'am4', change_model_function('gpt-4.1'), desc = 'Switch aider model to GPT-4.1' }, + { 'amo', change_model_function('openai/o4-mini'), desc = 'Switch aider model to o4-mini' }, + { 'amg', change_model_function('openai/gemini-2.5-pro'), desc = 'Switch aider model to Gemini 2.5 Pro' }, + { 'ams', change_model_function('openai/claude-sonnet-4'), desc = 'Switch aider model to Claude Sonnet 4' }, }, dependencies = { 'folke/snacks.nvim', diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index ba019e0..63c336c 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -14,11 +14,30 @@ return { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, + build = function() + if vim.fn.executable 'fd' == 0 then + local install_cmd + if vim.fn.has 'mac' == 1 then + install_cmd = 'brew install fd' + elseif vim.fn.has 'unix' == 1 then + if vim.fn.filereadable '/etc/arch-release' == 1 then + install_cmd = 'sudo pacman -S --noconfirm fd' + else + install_cmd = 'sudo apt-get install -y fd-find' + end + else + vim.notify("Please install 'fd' manually for neo-tree.", vim.log.levels.WARN) + return + end + vim.fn.system(install_cmd) + end + end, + opts = function(_, opts) local function on_move(data) Snacks.rename.on_rename_file(data.source, data.destination) end - local events = require("neo-tree.events") + local events = require 'neo-tree.events' opts.event_handlers = opts.event_handlers or {} vim.list_extend(opts.event_handlers, { { event = events.FILE_MOVED, handler = on_move },