Skip to content

๐Ÿค– Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!

License

Notifications You must be signed in to change notification settings

GeorgesAlkhouri/nvim-aider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

aider nvim-aider

๐Ÿค– Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!

screenshot_1 scrennshot_2

๐Ÿšง This plugin is in initial development. Expect breaking changes and rough edges.
October 17, 2024

๐ŸŒŸ Features

  • ๐Ÿ–ฅ๏ธ 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

๐ŸŽฎ Commands

  • โŒจ๏ธ 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

๐Ÿ”— Requirements

๐Ÿ 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.

๐Ÿ“ฆ Installation

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,
  }

โš™๏ธ Configuration

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",
  },
})

Made with ๐Ÿค– using Aider

About

๐Ÿค– Seamlessly integrate Aider with Neovim for an enhanced AI-assisted coding experience!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages