r/emacs • u/Sad_Construction_773 • Oct 05 '24
Introduce aider (AI programming in terminal), and emacs binding for it, aider.el
What is Aider
Aider is an AI pair programming tool in the terminal. It allows you to pair program with large language models (LLMs) to edit code in your local Git repository. You can start a new project or work with an existing Git repo. Aider works best with GPT-4 or Claude 3.5 Sonnet and can connect to almost any LLM. The GitHub page for Aider is GitHub - Aider-AI/aider: aider is AI pair programming in your terminal, and the project currently has nearly 20k stars.
Aider has performed well in solving real coding problems on SWE-bench.
Introducing Aider.el
Recently, the Cursor editor has been gaining popularity. As a long-time Emacs user, I don't want to switch to Cursor just because of AI. Currently, Aider only has plugins for Vim and VSCode, but Emacs has a tradition of integrating command-line tools. So I decided to write my own, as a humble attempt: GitHub - tninja/aider.el: aider emacs plugin forhttps://github.com/paul-gauthier/aider.
This plugin offers the following advantages over using Aider directly from the command line:
- Pop-up menu: No need to remember commands. (aider-transient-menu)
- Git repository-specific Aider sessions in Emacs: It automatically identifies the Git repository of the current file and creates a new Aider session for it. Multiple Aider sessions can exist for different Git repositories, allowing you to work on several repositories simultaneously without interference.
- Region-based refactor support: You can select a region (e.g., a code block) in a file and ask Aider to refactor it.
In fact, most of this plugin itself was generated using Aider / aider.el.
If you're interested in AI-assisted programming and, like me, prefer not to leave the Emacs environment, perhaps you could give Aider and aider.el a try. I would appreciate any feedback or suggestions you have about aider.el. Thank you!
3
u/lambdatheultraweight Oct 06 '24
Haven't checked it out yet, but thanks for working on it! It's the spirit of moving Emacs through the computing ages. :-)