diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index b663442ba90d..4e253749ee25 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -605,6 +605,18 @@ final: prev: meta.homepage = "https://github.com/aduros/ai.vim/"; }; + aider-nvim = buildVimPlugin { + pname = "aider.nvim"; + version = "2023-10-22"; + src = fetchFromGitHub { + owner = "joshuavial"; + repo = "aider.nvim"; + rev = "74a01227271d0ea211f2edafa82028b22d4c2022"; + sha256 = "jkco90IF948LuRILP3Bog3GelUGOQzsEw2jP4f9Ghbw="; + }; + meta.homepage = "https://github.com/joshuavial/aider.nvim/"; + }; + alchemist-vim = buildVimPlugin { pname = "alchemist.vim"; version = "2023-09-01"; diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index bb4aab02cc5d..24876a338736 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -131,6 +131,7 @@ hurl , # must be lua51Packages luajitPackages +, aider-chat , }: self: super: let @@ -1495,6 +1496,15 @@ in ''; }; + aider-nvim = super.aider-nvim.overrideAttrs { + patches = [ ./patches/aider.nvim/fix-paths.patch ]; + + postPatch = '' + substituteInPlace lua/aider.lua --replace '@aider@' ${aider-chat}/bin/aider + substituteInPlace lua/helpers.lua --replace '@aider@' ${aider-chat}/bin/aider + ''; + }; + refactoring-nvim = super.refactoring-nvim.overrideAttrs { dependencies = with self; [ nvim-treesitter plenary-nvim ]; }; diff --git a/pkgs/applications/editors/vim/plugins/patches/aider.nvim/fix-paths.patch b/pkgs/applications/editors/vim/plugins/patches/aider.nvim/fix-paths.patch new file mode 100644 index 000000000000..63995f0636dd --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/aider.nvim/fix-paths.patch @@ -0,0 +1,26 @@ +diff --git a/lua/aider.lua b/lua/aider.lua +index 38db0d1..d1ad6d5 100644 +--- a/lua/aider.lua ++++ b/lua/aider.lua +@@ -26,7 +26,7 @@ function M.AiderOpen(args, window_type) + if M.aider_buf and vim.api.nvim_buf_is_valid(M.aider_buf) then + helpers.open_buffer_in_new_window(window_type, M.aider_buf) + else +- command = 'aider ' .. (args or '') ++ command = '@aider@ ' .. (args or '') + helpers.open_window(window_type) + command = helpers.add_buffers_to_command(command) + M.aider_job_id = vim.fn.termopen(command, {on_exit = OnExit}) +diff --git a/lua/helpers.lua b/lua/helpers.lua +index 152182b..aa21584 100644 +--- a/lua/helpers.lua ++++ b/lua/helpers.lua +@@ -63,7 +63,7 @@ end + + local function build_background_command(args, prompt) + prompt = prompt or "Complete as many todo items as you can and remove the comment for any item you complete." +- local command = 'aider --msg "' .. prompt .. '" ' .. (args or '') ++ local command = '@aider@ --msg "' .. prompt .. '" ' .. (args or '') + command = add_buffers_to_command(command) + return command + end diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index f52477db72d9..b93ff96b984d 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -49,6 +49,7 @@ https://github.com/stevearc/aerial.nvim/,, https://github.com/Numkil/ag.nvim/,, https://github.com/derekelkins/agda-vim/,, https://github.com/aduros/ai.vim/,HEAD, +https://github.com/joshuavial/aider.nvim/,HEAD, https://github.com/slashmili/alchemist.vim/,, https://github.com/dense-analysis/ale/,, https://github.com/vim-scripts/align/,,