changed to agentic.nvim #14

Merged
sam_oneal merged 2 commits from agentic-nvim into main 2026-10-13 18:03:12 +00:00
6 changed files with 140 additions and 143 deletions
+2 -2
View File
@@ -142,7 +142,7 @@
"filename": "README.md", "filename": "README.md",
"hashed_secret": "9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684", "hashed_secret": "9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684",
"is_verified": false, "is_verified": false,
"line_number": 110 "line_number": 101
} }
], ],
"lazy-lock.json": [ "lazy-lock.json": [
@@ -582,5 +582,5 @@
} }
] ]
}, },
"generated_at": "2026-09-21T13:00:27Z" "generated_at": "2026-10-13T17:59:14Z"
} }
+5
View File
@@ -0,0 +1,5 @@
# AGENTS.md
## Output style
Keep output concise and limited to answering the task or question. Only produce text for the end user when you need to explain the final decision, ask a follow-up question, or request more work. Otherwise, do not narrate your process or emit status updates or summaries.
+47 -42
View File
@@ -62,7 +62,7 @@ CSS, JSON, YAML, Markdown, SQL, Dockerfile, Python.
| Testing | neotest (Go, Python, Zig) with in-buffer pass/fail signs | | Testing | neotest (Go, Python, Zig) with in-buffer pass/fail signs |
| Coverage | nvim-coverage (Go) | | Coverage | nvim-coverage (Go) |
| Task running | overseer.nvim (+ user templates) | | Task running | overseer.nvim (+ user templates) |
| AI chat | [opencode.nvim](https://github.com/nickjvandyke/opencode.nvim) (provider-agnostic) | | AI chat | [agentic.nvim](https://github.com/carlos-algms/agentic.nvim) (ACP; OpenCode by default) |
| Database | vim-dadbod + dadbod-ui + dadbod-completion | | Database | vim-dadbod + dadbod-ui + dadbod-completion |
| Git | Neogit + diffview, plus LazyVim's lazygit | | Git | Neogit + diffview, plus LazyVim's lazygit |
| Explorer/picker | snacks.nvim | | Explorer/picker | snacks.nvim |
@@ -70,37 +70,28 @@ CSS, JSON, YAML, Markdown, SQL, Dockerfile, Python.
| Diagnostics | trouble.nvim | | Diagnostics | trouble.nvim |
| Cheat sheet | which-key.nvim (hold `<leader>`) | | Cheat sheet | which-key.nvim (hold `<leader>`) |
### AI (opencode.nvim) ### AI (agentic.nvim)
AI is intentionally **environment-agnostic**: opencode.nvim drives the external AI is intentionally **environment-agnostic**: [agentic.nvim](https://github.com/carlos-algms/agentic.nvim)
[`opencode`](https://opencode.ai) CLI, so the model/provider (Anthropic, is a chat front-end for any agent that speaks the
OpenAI, local models, etc.) is chosen in opencode's own config rather than here. [Agent Client Protocol](https://agentclientprotocol.com) (ACP). We drive the
Install the `opencode` CLI separately and configure your provider there. external [`opencode`](https://opencode.ai) CLI through `opencode acp`, so the
model/provider (Anthropic, OpenAI, local models, etc.) is chosen in opencode's
own config rather than here. Install the `opencode` CLI separately and configure
your provider there.
> [!IMPORTANT] > [!NOTE]
> This integration requires the OpenCode **V1** CLI. opencode.nvim connects to > Unlike the previous opencode.nvim setup, **no version pinning or binary split
> the API server that `opencode --port` exposes; OpenCode **v2 removed that > is needed**. agentic spawns `opencode acp` from your normal `PATH`, so keep
> flag** and replaced the server API (v2 support in opencode.nvim is tracked > just the one `opencode` install. Other ACP providers (Claude, Codex, Gemini,
> upstream in [nickjvandyke/opencode.nvim#322](https://github.com/nickjvandyke/opencode.nvim/issues/322)). > Cursor, …) are built in — change `provider` in `lua/plugins/ai.lua`, or switch
> > at runtime with `<leader>ap`. Sessions are owned by the provider, so a chat
> **Binary split:** Neovim explicitly launches the pinned V1 binary at > started in the terminal can be pulled into Neovim and vice-versa
> `~/.opencode/bin/opencode` (see `opencode_cmd` in `lua/plugins/ai.lua` and the > (`<leader>ar`).
> `<leader>at` toggle in `lua/config/keymaps.lua`), so your terminal is free to
> keep using the latest `opencode` (v2) from its normal PATH. New sessions start in the **git worktree root** (`session_cwd` →
> `config.git-worktree.git_root`), so the agent edits the same checkout Neovim is
> Pin V1 with the install script (replace `1.18.31` with the latest V1 release): open in; outside a repo it falls back to Neovim's cwd.
>
> ```sh
> curl -fsSL https://opencode.ai/install | bash -s -- --version 1.18.31
> ```
>
> Do **not** put `~/.opencode/bin` on your shell PATH or set
> `OPENCODE_DISABLE_AUTOUPDATE=1` globally: installing the pinned binary via the
> script above prepends `~/.opencode/bin` to `PATH` in `~/.zshrc` (remove that
> line) and a global env var would stop the terminal's v2 from auto-updating.
> Instead, the config sets `OPENCODE_DISABLE_AUTOUPDATE=1` on the spawned V1
> process only, so the pinned binary can't replace itself with v2 while your
> terminal's opencode keeps updating.
### Database (vim-dadbod) ### Database (vim-dadbod)
@@ -129,14 +120,26 @@ clickable.
### AI (`<leader>a`) ### AI (`<leader>a`)
| Key | Action | | Key | Action |
| --------------------- | ---------------------------------- | | --------------------- | --------------------------------------------- |
| `<leader>aa` | Ask AI about current context (n/v) | | `<leader>aa` | Open AI chat, adding current file/selection |
| `<leader>ax` | Ask AI about selection | | `<leader>ax` | Add current file or selection to AI context |
| `<leader>at` | Toggle AI panel | | `<leader>at` | Toggle AI chat |
| `go` | Operator: add range to AI chat | | `<leader>an` | New AI session |
| `goo` | Add current line to AI chat | | `<leader>al` | Pick an AI session |
| `<S-C-u>` / `<S-C-d>` | Scroll AI chat up/down | | `<leader>ar` | Restore an AI session (incl. terminal ones) |
| `<leader>ap` | Switch ACP provider |
| `<leader>ad` | Add cursor-line diagnostics to AI context |
| `<leader>aD` | Add buffer diagnostics to AI context |
Inside the chat buffer agentic sets its own keys (see `:h agentic`): `<S-Tab>`
agent mode, `<localLeader>m` model, `<localLeader>s` provider, `<localLeader>l`
sessions, `q` hide (session keeps running), `]]`/`[[` headings, `]c`/`[c` diff
hunks.
> The old `go`/`goo` operators and `<S-C-u>`/`<S-C-d>` scroll keys are gone —
> agentic has no Vim operator, and it navigates context/diffs inside its own
> chat buffer (which is a normal Neovim buffer, not a terminal).
### Code › Go (`<leader>cg`) ### Code › Go (`<leader>cg`)
@@ -371,7 +374,7 @@ to anything reading it but is not printed in the statusline.
│ │ ├── neotest.lua # Test runner (go/python/zig) │ │ ├── neotest.lua # Test runner (go/python/zig)
│ │ ├── go-coverage.lua # Go coverage signs │ │ ├── go-coverage.lua # Go coverage signs
│ │ ├── overseer.lua # Task runner │ │ ├── overseer.lua # Task runner
│ │ ├── ai.lua # opencode.nvim │ │ ├── ai.lua # agentic.nvim
│ │ ├── dadbod.lua # Database │ │ ├── dadbod.lua # Database
│ │ ├── git.lua # Neogit + diffview │ │ ├── git.lua # Neogit + diffview
│ │ ├── worktree.lua # Git worktree keymaps (`<leader>gw/gW/gC`) │ │ ├── worktree.lua # Git worktree keymaps (`<leader>gw/gW/gC`)
@@ -420,6 +423,8 @@ to anything reading it but is not printed in the statusline.
## Known issues (in current repo) ## Known issues (in current repo)
One quirk remains in `lua/config/keymaps.lua`'s opencode block (present before - `agentic.nvim` sends `@`-mentioned files as **path references**, so the agent
these docs): `<leader>at` is also mapped in `t` (terminal) mode, not just `n` — reads them from disk: save the buffer before adding a file to the context. A
intentional, so the TUI terminal window itself can toggle the split. visual selection is inlined from the buffer, so unsaved edits there are fine.
- OpenCode's interactive `question` tool is excluded over ACP by default; enable
it with `OPENCODE_ENABLE_QUESTION_TOOL=1` if you need structured prompts.
+1 -1
View File
@@ -3,6 +3,7 @@
"LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" }, "LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" },
"SchemaStore.nvim": { "branch": "main", "commit": "a0fad73139f98ea1d6e9d380374c16245e562f4f" }, "SchemaStore.nvim": { "branch": "main", "commit": "a0fad73139f98ea1d6e9d380374c16245e562f4f" },
"aerial.nvim": { "branch": "master", "commit": "7a6a42791eb2b54a7115c7db4488981f93471770" }, "aerial.nvim": { "branch": "master", "commit": "7a6a42791eb2b54a7115c7db4488981f93471770" },
"agentic.nvim": { "branch": "main", "commit": "5ee51100ce213fed47c9307065155b87ee873141" },
"avante.nvim": { "branch": "main", "commit": "e1e70be8ee34144d3ce4b0608e9b30aab3feb701" }, "avante.nvim": { "branch": "main", "commit": "e1e70be8ee34144d3ce4b0608e9b30aab3feb701" },
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
@@ -31,7 +32,6 @@
"neotest-golang": { "branch": "main", "commit": "53f06063780b0b244583d3d32b138fc2df21e162" }, "neotest-golang": { "branch": "main", "commit": "53f06063780b0b244583d3d32b138fc2df21e162" },
"neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"opencode.nvim": { "branch": "main", "commit": "84eabfbe65a44f452ee302fe360cea9fd9939f31" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" },
"nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" }, "nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" },
+2 -31
View File
@@ -60,38 +60,9 @@ map("n", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move selection down" })
map("n", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move selection up" }) map("n", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move selection up" })
-- ───────────────────────────────────────────────────────────────────────────── -- ─────────────────────────────────────────────────────────────────────────────
-- AI (OpenCode) -- AI keymaps live in lua/plugins/ai.lua (agentic.nvim) so the plugin loads
-- lazily on first keypress.
-- ───────────────────────────────────────────────────────────────────────────── -- ─────────────────────────────────────────────────────────────────────────────
map({ "n", "x" }, "<leader>aa", function()
require("opencode").ask("@this: ", { submit = true })
end, { desc = "AI Ask" })
map({ "n", "x" }, "<leader>ax", function()
require("opencode").select()
end, { desc = "AI Ask (selection)" })
map({ "n", "t" }, "<leader>at", function()
-- opencode.nvim v1.0.2 removed `opencode.toggle()`; toggle the TUI terminal
-- directly. Command, `env` and window opts must match `opencode_cmd` and
-- `snacks_terminal_opts` in lua/plugins/ai.lua so `snacks.terminal.tid`
-- identifies the same terminal.
require("snacks.terminal").toggle(vim.fn.expand("$HOME/.opencode/bin/opencode") .. " --port", {
env = { OPENCODE_DISABLE_AUTOUPDATE = "1" },
win = { position = "right", enter = false },
})
end, { desc = "AI Toggle" })
map({ "n", "x" }, "go", function()
return require("opencode").operator("@this ")
end, { desc = "Add range to AI chat", expr = true })
map("n", "goo", function()
return require("opencode").operator("@this ") .. "_"
end, { desc = "Add line to AI chat", expr = true })
map("n", "<S-C-u>", function()
require("opencode").command("session.half.page.up")
end, { desc = "Scroll AI chat up" })
map("n", "<S-C-d>", function()
require("opencode").command("session.half.page.down")
end, { desc = "Scroll AI chat down" })
-- ───────────────────────────────────────────────────────────────────────────── -- ─────────────────────────────────────────────────────────────────────────────
-- Database (vim-dadbod) -- Database (vim-dadbod)
+83 -67
View File
@@ -1,75 +1,91 @@
return { return {
{ {
-- Drive the OpenCode TUI from Neovim. -- Chat front-end for AI agents that speak the Agent Client Protocol (ACP).
-- --
-- IMPORTANT: this integration requires the OpenCode **V1** CLI. opencode.nvim -- We drive OpenCode through its ACP server (`opencode acp`), so this works
-- connects to the HTTP API that `opencode --port` exposes; OpenCode v2 removed -- with whatever `opencode` is on PATH — no version pinning and no separate
-- that flag and replaced the server API, which opencode.nvim does not support -- pinned binary (the old opencode.nvim setup needed both, because it talked
-- yet (https://github.com/nickjvandyke/opencode.nvim/issues/322). -- to the V1 `--port` server API that v2 removed). Other ACP providers
"nickjvandyke/opencode.nvim", -- (Claude, Codex, Gemini, Cursor, ...) are built in; see `provider` below.
version = "v1.0.2", "carlos-algms/agentic.nvim",
dependencies = { keys = {
{ {
---@module "snacks" "<leader>aa",
"folke/snacks.nvim", function()
optional = true, require("agentic").open()
opts = { end,
input = {}, -- Enhances `ask()` mode = { "n", "v" },
picker = { -- Enhances `select()` desc = "AI Ask",
actions = { },
opencode_send = function(picker) ---@param picker snacks.Picker {
local items = vim.tbl_map(function(item) ---@param item snacks.picker.Item "<leader>ax",
return item.file function()
and require("opencode").format({ path = item.file, from = item.pos, to = item.end_pos }) require("agentic").add_selection_or_file_to_context()
or item.text end,
end, picker:selected({ fallback = true })) mode = { "n", "v" },
desc = "AI Add context",
require("opencode").prompt(table.concat(items, ", ") .. " ") },
end, {
}, "<leader>at",
win = { function()
input = { require("agentic").toggle()
keys = { end,
["<a-a>"] = { "opencode_send", mode = { "n", "i" } }, desc = "AI Toggle",
}, },
}, {
}, "<leader>an",
}, function()
}, require("agentic").new_session()
end,
mode = { "n", "v" },
desc = "AI New session",
},
{
"<leader>al",
function()
require("agentic").select_session()
end,
desc = "AI Sessions",
},
{
"<leader>ar",
function()
require("agentic").restore_session()
end,
desc = "AI Restore session",
},
{
"<leader>ap",
function()
require("agentic").switch_provider()
end,
desc = "AI Switch provider",
},
{
"<leader>ad",
function()
require("agentic").add_current_line_diagnostics()
end,
desc = "AI Add line diagnostics",
},
{
"<leader>aD",
function()
require("agentic").add_buffer_diagnostics()
end,
desc = "AI Add buffer diagnostics",
}, },
}, },
config = function() ---@type agentic.PartialUserConfig
-- `--port` exposes OpenCode's HTTP API, which opencode.nvim discovers and opts = {
-- connects to. V1 CLI only; v2 removed this flag. -- OpenCode is the provider this config drives (agentic defaults to Claude).
-- provider = "opencode-acp",
-- Binary split: nvim explicitly uses the pinned V1 binary at -- Start new sessions in the git worktree being edited (the worktree
-- ~/.opencode/bin/opencode while the interactive shell keeps using the -- top-level, not a nested subdirectory) so the agent touches the same
-- latest `opencode` (v2) from its PATH. Keep this in sync with the -- checkout Neovim is open in. Falls back to Neovim's cwd outside a repo.
-- `<leader>at` toggle in lua/config/keymaps.lua. session_cwd = function(cwd)
local opencode_cmd = vim.fn.expand("$HOME/.opencode/bin/opencode") .. " --port" return require("config.git-worktree").git_root(cwd)
---@type snacks.terminal.Opts end,
local snacks_terminal_opts = { },
-- V1 checks for updates on startup and would replace itself with V2;
-- disable autoupdate for this pinned binary only (does not affect the
-- terminal's v2, which keeps updating).
env = { OPENCODE_DISABLE_AUTOUPDATE = "1" },
win = {
position = "right",
enter = false,
},
}
---@type opencode.Opts
vim.g.opencode_opts = {
server = {
start = function()
require("snacks.terminal").open(opencode_cmd, snacks_terminal_opts)
end,
},
}
-- Reload buffers that OpenCode edits (the plugin also sets this itself)
vim.o.autoread = true -- Required for `opts.events.reload`
end,
}, },
} }