GitHub - loukotal/neopencode.nvim

A Neovim plugin to interact with opencode.ai.

Name is not great, but didn't want to sit on opencode.nvim

Note

Proof of concept. And 100% opencoded. Compatible with opencode v0.3.13.

Features

  • List and select opencode.ai sessions from all running instances.
  • Send the current filename to an opencode.ai session.
  • Send the selected lines to an opencode.ai session.
  • Support for multiple opencode instances running simultaneously.

Small demo

demo2_c.mp4

Installation

Use your favorite plugin manager.

lazy.nvim

{
  "loukotal/neopencode.nvim",
  config = function()
    require("neopencode.main").setup({
      -- follows https://models.dev/
      -- needs to be setup in opencode
      provider_id = "google",
      model_id = "gemini-2.5-pro-preview-06-05",
    })
  end,
}

Usage

  • :OpencodeSelectSession - Select an active opencode.ai session from all running instances.
  • :OpencodeFile - Send the current file to the selected session (prefills @filename in prompt).
  • :OpencodeSelect - Send the selected lines to the selected session (prefills @filename with selection).

Configuration

You can configure the plugin by calling the setup function.

require("neopencode.main").setup({
  provider_id = "anthropic",
  model_id = "claude-sonnet-4-20250514",
})

TODOs

  • better session picking
  • there should not be a setup for the model, it should use whatever the session was using
  • there should be a way to select a model that is set up in opencode - so you can use a different model for each message when needed
  • creating a new session does not update opencode ui and the session needs to be selected in opencode