← all repositories
David-Kunz/gen.nvim

Local LLMs inside Neovim, no cloud required

A Lua plugin that wires Ollama directly into your editor so you can generate, rewrite, and chat with models without leaving your buffer.

gen.nvim
Velocity · 7d
+1.6
★ / day
Trend
steady
star history

What it does

gen.nvim is a Neovim plugin that talks to a local Ollama instance via curl, letting you run LLM prompts against selected text or entire buffers. It ships with predefined prompts for tasks like grammar fixes and code improvements, supports follow-up chat with context memory, and can replace your selection with the model’s output in-place.

The interesting bit

The plugin is essentially a thin Lua wrapper around a curl POST to Ollama’s /api/chat endpoint, but it gets the UX right: prompts are plain Lua tables with placeholders like $text and $filetype, and you can extract specific output with regex. The “hidden” mode even streams results directly into your buffer without opening a window.

Key highlights

  • Prompts are fully customizable Lua tables with placeholders for selected text, filetype, user input, or register contents
  • Supports streaming responses in a float, split, or hidden mode (Neovim ≥ 0.10)
  • Context-aware chat: follow-up questions keep the conversation thread until you close the window
  • Model selection via select_model() picks from your locally installed Ollama models
  • Optional Telescope integration for fuzzy-selecting prompts

Caveats

  • Requires Ollama running locally and curl installed; no remote API support out of the box
  • The default init function silently shells out to ollama serve in the background, which may surprise you if you already manage the service yourself

Verdict

Worth a look if you want local, offline LLM assistance inside Neovim without the heft of a full AI coding suite. Skip it if you need cloud model access or deep IDE-style integration.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.