{"id":27464614,"url":"https://github.com/GeorgesAlkhouri/nvim-aider","last_synced_at":"2025-04-15T23:01:27.218Z","repository":{"id":263660207,"uuid":"891091963","full_name":"GeorgesAlkhouri/nvim-aider","owner":"GeorgesAlkhouri","description":"🤖 Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!","archived":false,"fork":false,"pushed_at":"2025-04-06T19:25:59.000Z","size":116,"stargazers_count":155,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T05:08:24.009Z","etag":null,"topics":["ai-coding","aider","lua","neovim","neovim-plugin","terminal-integration"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeorgesAlkhouri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-19T17:58:02.000Z","updated_at":"2025-04-07T04:47:38.000Z","dependencies_parsed_at":"2024-11-19T19:21:18.630Z","dependency_job_id":"c96f6473-378b-45c8-ab58-60f313f8f2cf","html_url":"https://github.com/GeorgesAlkhouri/nvim-aider","commit_stats":null,"previous_names":["georgesalkhouri/nvim-aider"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgesAlkhouri%2Fnvim-aider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgesAlkhouri%2Fnvim-aider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgesAlkhouri%2Fnvim-aider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgesAlkhouri%2Fnvim-aider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeorgesAlkhouri","download_url":"https://codeload.github.com/GeorgesAlkhouri/nvim-aider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167446,"owners_count":21223506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","aider","lua","neovim","neovim-plugin","terminal-integration"],"created_at":"2025-04-15T23:01:26.378Z","updated_at":"2025-04-15T23:01:27.185Z","avatar_url":"https://github.com/GeorgesAlkhouri.png","language":"Lua","funding_links":[],"categories":["AI","Lua"],"sub_categories":["(requires Neovim 0.5)","Diagnostics"],"readme":"# [![aider](https://avatars.githubusercontent.com/u/172139148?s=20\u0026v=4)](https://aider.chat) nvim-aider\n\n🤖 Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!\n\n\u003cimg width=\"1280\" alt=\"screenshot_1\" src=\"https://github.com/user-attachments/assets/5d779f73-5441-4d24-8cce-e6dfdc5bf787\" /\u003e\n\u003cimg width=\"1280\" alt=\"screenshot_2\" src=\"https://github.com/user-attachments/assets/3c122846-ca27-42d3-8cbf-f6e5f9b10f69\" /\u003e\n\n\u003e 🚧 This plugin is in initial development. Expect breaking changes and rough edges.\n\u003e _October 17, 2024_\n\n## 🌟 Features\n\n- [x] 🖥️ Aider terminal integration within Neovim\n- [x] 🎨 Color theme configuration support with auto Catppuccin flavor synchronization\n      if available\n- [x] 📤 Quick commands to add/drop current buffer files\n- [x] 📤 Send buffers or selections to Aider\n- [x] 💬 Optional user prompt for buffer and selection sends\n- [x] 🩺 Send current buffer diagnostics to Aider\n- [x] 🔍 Aider command selection UI with fuzzy search and input prompt\n- [x] 🔌 Fully documented [Lua API](lua/nvim_aider/api.lua) for\n      programmatic interaction and custom integrations\n- [x] 🌲➕ [Neo-tree](https://github.com/nvim-neo-tree/neo-tree.nvim)\n      integration also with multi-file/directory selection with visual mode support\n- [x] 🌳 Integration with [nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua)\n      for adding or dropping files directly from the tree interface\n\n## 🎮 Commands\n\n- `:Aider` - Open interactive command menu\n\n  ```text\n  Commands:\n  health         🩺 Check plugin health status\n  toggle         🎛️ Toggle Aider terminal window\n  send           📤 Send text to Aider (prompt if empty)\n  command        ⌨️ Show slash commands\n  buffer         📄 Send current buffer\n   \u003e diagnostics 🩺 Send current buffer diagnostics\n  add            ➕ Add file to session\n   \u003e readonly    👀 Add as read-only reference\n  drop           🗑️ Remove file from session\n  ```\n\n- ⚡ Direct command execution examples:\n\n  ```vim\n  :Aider health\n  :Aider add readonly\n  :Aider send \"Fix login validation\"\n  ```\n\n## 🔗 Requirements\n\n🐍 Python: Install `aider-chat`\n📋 System: **Neovim** \u003e= 0.9.4, ~~Working clipboard~~ thanks to @milanglacier\n🌙 Lua: `folke/snacks.nvim`,\n_optionals_ `catppuccin/nvim`, `nvim-neo-tree/neo-tree.nvim`, `nvim-tree.lua`\n\n## 📦 Installation\n\nUsing lazy.nvim:\n\n```lua\n{\n    \"GeorgesAlkhouri/nvim-aider\",\n    cmd = \"Aider\",\n    -- Example key mappings for common actions:\n    keys = {\n      { \"\u003cleader\u003ea/\", \"\u003ccmd\u003eAider toggle\u003ccr\u003e\", desc = \"Toggle Aider\" },\n      { \"\u003cleader\u003eas\", \"\u003ccmd\u003eAider send\u003ccr\u003e\", desc = \"Send to Aider\", mode = { \"n\", \"v\" } },\n      { \"\u003cleader\u003eac\", \"\u003ccmd\u003eAider command\u003ccr\u003e\", desc = \"Aider Commands\" },\n      { \"\u003cleader\u003eab\", \"\u003ccmd\u003eAider buffer\u003ccr\u003e\", desc = \"Send Buffer\" },\n      { \"\u003cleader\u003ea+\", \"\u003ccmd\u003eAider add\u003ccr\u003e\", desc = \"Add File\" },\n      { \"\u003cleader\u003ea-\", \"\u003ccmd\u003eAider drop\u003ccr\u003e\", desc = \"Drop File\" },\n      { \"\u003cleader\u003ear\", \"\u003ccmd\u003eAider add readonly\u003ccr\u003e\", desc = \"Add Read-Only\" },\n      -- Example nvim-tree.lua integration if needed\n      { \"\u003cleader\u003ea+\", \"\u003ccmd\u003eAiderTreeAddFile\u003ccr\u003e\", desc = \"Add File from Tree to Aider\", ft = \"NvimTree\" },\n      { \"\u003cleader\u003ea-\", \"\u003ccmd\u003eAiderTreeDropFile\u003ccr\u003e\", desc = \"Drop File from Tree from Aider\", ft = \"NvimTree\" },\n    },\n    dependencies = {\n      \"folke/snacks.nvim\",\n      --- The below dependencies are optional\n      \"catppuccin/nvim\",\n      \"nvim-tree/nvim-tree.lua\",\n      --- Neo-tree integration\n      {\n        \"nvim-neo-tree/neo-tree.nvim\",\n        opts = function(_, opts)\n          -- Example mapping configuration (already set by default)\n          -- opts.window = {\n          --   mappings = {\n          --     [\"+\"] = { \"nvim_aider_add\", desc = \"add to aider\" },\n          --     [\"-\"] = { \"nvim_aider_drop\", desc = \"drop from aider\" }\n          --   }\n          -- }\n          require(\"nvim_aider.neo_tree\").setup(opts)\n        end,\n      },\n    },\n    config = true,\n  }\n```\n\n## ⚙️ Configuration\n\nThere is no need to call setup if you don't want to change the default options.\n\n```lua\nrequire(\"nvim_aider\").setup({\n  -- Command that executes Aider\n  aider_cmd = \"aider\",\n  -- Command line arguments passed to aider\n  args = {\n    \"--no-auto-commits\",\n    \"--pretty\",\n    \"--stream\",\n  },\n  -- Theme colors (automatically uses Catppuccin flavor if available)\n  theme = {\n    user_input_color = \"#a6da95\",\n    tool_output_color = \"#8aadf4\",\n    tool_error_color = \"#ed8796\",\n    tool_warning_color = \"#eed49f\",\n    assistant_output_color = \"#c6a0f6\",\n    completion_menu_color = \"#cad3f5\",\n    completion_menu_bg_color = \"#24273a\",\n    completion_menu_current_color = \"#181926\",\n    completion_menu_current_bg_color = \"#f4dbd6\",\n  },\n  -- snacks.picker.layout.Config configuration\n  picker_cfg = {\n    preset = \"vscode\",\n  },\n  -- Other snacks.terminal.Opts options\n  config = {\n    os = { editPreset = \"nvim-remote\" },\n    gui = { nerdFontsVersion = \"3\" },\n  },\n  win = {\n    wo = { winbar = \"Aider\" },\n    style = \"nvim_aider\",\n    position = \"right\",\n  },\n})\n```\n\n## 📚 API Reference\n\nThe plugin provides a structured API for programmatic integration. Access via `require(\"nvim_aider\").api`\n\n### Core Functions\n\n```lua\nlocal api = require(\"nvim_aider\").api\n```\n\n#### `health_check()`\n\nVerify plugin health status\n\n```lua\napi.health_check()\n```\n\n#### `toggle_terminal(opts?)`\n\nToggle Aider terminal window\n\n```lua\napi.toggle_terminal()\n```\n\n---\n\n### Terminal Operations\n\n#### `send_to_terminal(text, opts?)`\n\nSend raw text directly to Aider\n\n```lua\napi.send_to_terminal(\"Fix the login validation\")\n```\n\n#### `send_command(command, input?, opts?)`\n\nExecute specific Aider command\n\n```lua\napi.send_command(\"/commit\", \"Add error handling\")\n```\n\n---\n\n### File Management\n\n#### `add_file(filepath)`\n\nAdd specific file to session\n\n```lua\napi.add_file(\"/src/utils.lua\")\n```\n\n#### `drop_file(filepath)`\n\nRemove file from session\n\n```lua\napi.drop_file(\"/outdated/legacy.py\")\n```\n\n#### `add_current_file()`\n\nAdd current buffer's file (uses `add_file` internally)\n\n```lua\nvim.api.nvim_create_autocmd(\"BufWritePost\", {\n  callback = function()\n    api.add_current_file()\n  end\n})\n```\n\n#### `drop_current_file()`\n\nRemove current buffer's file\n\n```lua\napi.drop_current_file()\n```\n\n#### `add_read_only_file()`\n\nAdd current buffer as read-only reference\n\n```lua\napi.add_read_only_file()\n```\n\n---\n\n### Buffer Operations\n\n#### `send_buffer_with_prompt(opts?)`\n\nSend entire buffer content with optional prompt\n\n```lua\napi.send_buffer_with_prompt()\n```\n\n#### `send_diagnostics_with_prompt(opts?)`\n\nSend current buffer's diagnostics with an optional prompt\n\n```lua\napi.send_diagnostics_with_prompt()\n```\n\n---\n\n### UI Components\n\n#### `open_command_picker(opts?, callback?)`\n\nInteractive command selector with custom handling\n\n```lua\napi.open_command_picker(nil, function(picker, item)\n  if item.text == \"/custom\" then\n    -- Implement custom command handling\n  else\n    -- Default behavior\n    picker:close()\n    api.send_command(item.text)\n  end\nend)\n```\n\n---\n\n## 🧩 Other Aider Neovim plugins\n\n- [aider.nvim](https://github.com/joshuavial/aider.nvim)\n- [aider.vim](https://github.com/nekowasabi/aider.vim)\n\n---\n\n\u003cdiv align=\"center\"\u003e\nMade with 🤖 using \u003ca href=\"https://github.com/paul-gauthier/aider\"\u003eAider\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGeorgesAlkhouri%2Fnvim-aider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGeorgesAlkhouri%2Fnvim-aider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGeorgesAlkhouri%2Fnvim-aider/lists"}