vim-chatgpt  by CoderCookE

Vim plugin for interacting with OpenAI's ChatGPT API

created 2 years ago
264 stars

Top 97.5% on sourcepulse

GitHubView on GitHub
Project Summary

This Vim plugin integrates OpenAI's ChatGPT API directly into the Vim editor, allowing developers to request code explanations, rewrites, reviews, and more without leaving their workflow. It targets Vim users who want to leverage AI for code assistance and improve productivity.

How It Works

The plugin utilizes the OpenAI API, requiring an API key for authentication. Users can select code snippets within Vim and execute commands like :Explain, :Review, or :Rewrite. The selected code, along with optional context, is sent to the ChatGPT API, and the response is displayed in a new Vim buffer. It supports various customization options for models, session persistence, and response parameters.

Quick Start & Requirements

  • Install via pip install openai.
  • Requires Vim with Python 3 support.
  • An OpenAI API key is mandatory.
  • Environment variables OPENAI_API_KEY or .vimrc configuration (g:openai_api_key) are needed.
  • Optional proxy configuration via OPENAI_PROXY or OPENAI_API_BASE.
  • Official documentation: [Not explicitly linked, but installation instructions are provided.]

Highlighted Details

  • Supports multiple ChatGPT models (e.g., gpt-4o, gpt-3.5-turbo-16k, gpt-4).
  • Customizable personas for tailored AI interactions.
  • Allows defining custom prompt templates for specific tasks.
  • Offers commands for explanation, review, rewrite, documentation, testing, fixing, and commit message generation.

Maintenance & Community

  • No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.
  • Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The plugin is not affiliated with OpenAI. Users are responsible for API usage costs. The README does not detail specific limitations regarding supported Vim versions beyond Python 3 support, or potential performance bottlenecks.

Health Check
Last commit

6 months ago

Responsiveness

1+ week

Pull Requests (30d)
1
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.