๐ค Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!
๐ง This plugin is in initial development. Expect breaking changes and rough edges.
October 17, 2024
- ๐ฅ๏ธ Aider terminal integration within Neovim
- ๐จ Color theme configuration support with auto Catppuccin flavor synchronization if available
- ๐ค Quick commands to add/drop current buffer files
- ๐ค Send buffers or selections to Aider
- ๐ฌ Optional user prompt for buffer and selection sends
- ๐ Aider command selection UI with fuzzy search and input prompt
- โจ๏ธ
AiderTerminalToggle
- Toggle the Aider terminal window - ๐ค
AiderTerminalSend [text]
- Send text to Aider- Without arguments: Opens input prompt
- With arguments: Sends provided text directly
- In visual mode: Sends selected text with an optional prompt
- ๐
AiderQuickSendCommand
- List all Aider commands in telescope picker with option to add prompt after selection - ๐
AiderQuickAddFile
- Add current buffer file to Aider session - ๐๏ธ
AiderQuickDropFile
- Remove current buffer file from Aider session - ๐
AiderQuickSendBuffer
- Send entire buffer content to Aider with an optional prompt
๐ Python: Install aider
๐ System: Neovim >= 0.9.4, Working clipboard
๐ Lua: folke/snacks.nvim
, nvim-telescope/telescope.nvim
,
optionals catppuccin/nvim
Note: ๐ This plugin requires a working system clipboard as it sends text to the terminal via Aider's /paste commands, which inserts the system clipboard register for the best compatibility.
Using lazy.nvim:
{
"GeorgesAlkhouri/nvim-aider",
cmd = {
"AiderTerminalToggle",
},
keys = {
{ "<leader>a/", "<cmd>AiderTerminalToggle<cr>", desc = "Open Aider" },
{ "<leader>as", "<cmd>AiderTerminalSend<cr>", desc = "Send to Aider", mode = { "n", "v" } },
{ "<leader>ac", "<cmd>AiderQuickSendCommand<cr>", desc = "Send Command To Aider" },
{ "<leader>ab", "<cmd>AiderQuickSendBuffer<cr>", desc = "Send Buffer To Aider" },
{ "<leader>a+", "<cmd>AiderQuickAddFile<cr>", desc = "Add File to Aider" },
{ "<leader>a-", "<cmd>AiderQuickDropFile<cr>", desc = "Drop File from Aider" },
},
dependencies = {
"folke/snacks.nvim",
"nvim-telescope/telescope.nvim",
--- The below dependencies are optional
"catppuccin/nvim",
},
config = true,
}
There is no need to call setup if you don't want to change the default options.
require("nvim_aider").setup({
-- Command line arguments passed to aider
args = {
"--no-auto-commits",
"--pretty",
"--stream",
},
-- Theme colors (automatically uses Catppuccin flavor if available)
theme = {
user_input_color = "#a6da95",
tool_output_color = "#8aadf4",
tool_error_color = "#ed8796",
tool_warning_color = "#eed49f",
assistant_output_color = "#c6a0f6",
completion_menu_color = "#cad3f5",
completion_menu_bg_color = "#24273a",
completion_menu_current_color = "#181926",
completion_menu_current_bg_color = "#f4dbd6",
},
-- Other snacks.terminal.Opts options
config = {
os = { editPreset = "nvim-remote" },
gui = { nerdFontsVersion = "3" },
},
win = {
style = "nvim_aider",
position = "bottom",
},
})