vim-ai  by madox2

AI plugin for Vim/Neovim, adding AI capabilities

created 2 years ago
991 stars

Top 38.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This plugin provides AI-powered code assistance for Vim and Neovim, enabling users to generate code, edit text, and engage in interactive chat with GPT models via OpenAI's API. It targets developers and power users seeking to integrate advanced AI capabilities directly into their editing workflow.

How It Works

The plugin leverages OpenAI's API to process user requests, which can include selected text, custom prompts, or conversational input. Users need an OpenAI API key, and costs are token-based. The plugin emphasizes that it only sends explicitly selected or prompted content, not entire files, ensuring user privacy. It also supports OpenAI-compatible proxies for using alternative models like Gemini or Claude.

Quick Start & Requirements

  • Installation: Use a Vim package manager (e.g., Plug 'madox2/vim-ai') or manual installation via Vim's built-in packages.
  • Prerequisites: Vim or Neovim compiled with Python 3 support.
  • API Key: Configure your OpenAI API key by saving it to ~/.config/openai.token, or as an environment variable OPENAI_API_KEY.
  • Configuration: Customize API endpoints, models, and behavior via .vimrc variables.
  • Documentation: vim-ai

Highlighted Details

  • Supports text/code generation, in-place editing, interactive chat, image generation, and vision capabilities.
  • Extensible with custom provider plugins for different AI models.
  • Allows defining custom roles for reusable prompts and configurations.
  • Can include file contents and execute shell commands within chat prompts.

Maintenance & Community

  • Contributions are welcome via pull requests and issue reports.
  • A Community Wiki is available for prompts, custom commands, and provider information.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Suitable for commercial use and integration with closed-source projects, provided OpenAI's terms of service are met.

Limitations & Caveats

AI-generated output may appear correct but can be factually wrong; thorough review is essential. The plugin handles sensitive information by transmitting it to third-party AI providers, making it unsuitable for confidential data.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
6
Star History
80 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.