A Neovim plugin that provides as-you-type AI code completion using OpenAI, Gemini, Claude, Ollama, llama.cpp, Codestral and other LLM providers.
gergap/vim-ollama
A Vim plugin that adds Copilot-style code completion, chat and AI-assisted editing, backed by a local Ollama server or OpenAI-compatible and Mistral APIs.
Open-source alternative to:GitHub Copilot
- Stars
- 334
- Forks
- 38
- Open issues
- 10
- Last commit
- 19 days ago
What is it?
vim-ollama brings Copilot-like inline code completion to Vim. Completions appear as ghost text and are accepted with a key press. The plugin talks to an Ollama server through its REST API, so models can run locally without sending code to a cloud service. It also includes an interactive chat window for code review and general questions.
Beyond completion, the OllamaEdit feature lets the model edit a selected range or work across a project workspace. It can inspect files, apply changes, run build and validation tools, and fix compiler diagnostics with :OllamaQuickFix. Changes stay under Vim's control, and a Plan mode restricts the model to read-only inspection. Web search and page fetching tools are available when an API key is configured.
The plugin supports OpenAI-compatible endpoints such as LMStudio and Open WebUI, as well as the OpenAI and Mistral APIs. API keys can be read from environment variables or from the pass password manager. It targets Vim only, not Neovim, and includes a setup wizard that creates a Python virtual environment for its dependencies.
Key features
- 01Inline ghost-text code completion accepted with Tab, with line- and word-level acceptance.
- 02Chat window for code reviews and general questions with the configured model.
- 03OllamaEdit performs natural-language edits on a selection or across a project workspace.
- 04Fixes compiler diagnostics automatically with :OllamaQuickFix.
- 05Works with local Ollama models and OpenAI-compatible, OpenAI, and Mistral endpoints.
- 06Setup wizard creates a Python virtual environment and installs dependencies.
Use cases
- Getting Copilot-style completions in terminal Vim without sending code to a cloud provider.
- Reviewing code or asking questions about a file from within Vim using a local model.
- Making multi-file or selection-based edits with an AI assistant while keeping changes reviewable in Vim.
- Running the plugin against LMStudio or another self-hosted OpenAI-compatible server.
Quick start
- 1
Add the plugin to your vimrc with vim-plug
- 2
Restart Vim and run the setup wizard
:Ollama setup - 3
Open the configuration file if you want to change settings
:Ollama config
Things to know
- Works only with Vim, not NeoVim.
- Requires Python 3.x.
- OllamaEdit can change project files and run tools, so review its changes before trusting them.
In collections
Topics
FAQ
- What is vim-ollama?
- A Vim plugin that adds Copilot-style code completion, chat and AI-assisted editing, backed by a local Ollama server or OpenAI-compatible and Mistral APIs. vim-ollama brings Copilot-like inline code completion to Vim. Completions appear as ghost text and are accepted with a key press. The plugin talks to an Ollama server through its REST API, so models can run locally without sending code to a cloud service. It also includes an interactive chat window for code review and general questions.
- Is vim-ollama free to use? What license does it have?
- vim-ollama is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
- Is vim-ollama still maintained?
- Actively maintained. The last commit to vim-ollama was on Oct 19, 2026.
- What can I use vim-ollama for?
- Getting Copilot-style completions in terminal Vim without sending code to a cloud provider. Reviewing code or asking questions about a file from within Vim using a local model. Making multi-file or selection-based edits with an AI assistant while keeping changes reviewable in Vim. Running the plugin against LMStudio or another self-hosted OpenAI-compatible server.
- How do I install vim-ollama?
- Add the plugin to your vimrc with vim-plug Restart Vim and run the setup wizard: :Ollama setup Open the configuration file if you want to change settings: :Ollama config
- Where can I get vim-ollama?
- The source code and installation instructions are on GitHub: https://github.com/gergap/vim-ollama
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An Emacs package that brings as-you-type code completion from LLMs such as OpenAI, Claude, Gemini, Ollama and llama.cpp into your editor.
An Xcode Source Editor Extension that adds GitHub Copilot, Codeium and ChatGPT code suggestions, chat and code modification to Xcode.
Vim plugin that provides local LLM-powered fill-in-the-middle code completion and instruction-based editing via a llama.cpp server.
An open-source coding agent for the terminal that runs on local models via Ollama or any OpenAI-compatible API.
VS Code extension for local LLM code completion, AI chat, and an agentic coding assistant backed by llama.cpp.