vim-ollama  by gergap

Vim plugin for local LLM code completion and chat

Created 1 year ago
275 stars

Top 94.0% on SourcePulse

GitHubView on GitHub
Project Summary

This plugin provides Copilot-like code completion and chat functionality within Vim, leveraging locally run Ollama-compatible LLMs for enhanced privacy and offline capabilities. It targets Vim users who prefer not to switch to NeoVim and want to utilize open-source models like Llama3 or Codellama.

How It Works

The plugin integrates with Ollama via its REST API using Python scripts (complete.py, chat.py). These scripts handle code completion and chat interactions, respectively. Vim communicates with these scripts through standard input/output redirection, seamlessly embedding AI-generated suggestions and chat responses directly into the Vim editing experience.

Quick Start & Requirements

  • Installation: Use a Vim plugin manager (e.g., vim-plug: Plug 'gergap/vim-ollama').
  • Prerequisites: Python 3.x, Ollama server running locally. The plugin can automatically create a Python virtual environment and install dependencies (httpx, requests, jinja2) via a setup wizard (:Ollama setup).
  • Setup Time: Minimal, primarily dependent on Ollama setup and model download.
  • Docs: :help vim-ollama within Vim.

Highlighted Details

  • Offers intelligent AI-based code completion, integrated chat, and automatic code editing based on natural language.
  • Supports interactive acceptance of changes via inline-diff view or a Git-based workflow with vim-fugitive.
  • Prioritizes Vim compatibility, explicitly stating it does not support NeoVim.
  • Includes a setup wizard for easier configuration and Python virtual environment management.

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

This plugin is strictly for Vim and does not support NeoVim. Adding support for new, unsupported code completion models requires manual creation of JSON configuration files.

Health Check
Last Commit

1 day ago

Responsiveness

1 week

Pull Requests (30d)
2
Issues (30d)
2
Star History
6 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.