From 0997992dcdbc762451ca138e8f2617ee7ff48658 Mon Sep 17 00:00:00 2001 From: leohenon <77656081+lhenon999@users.noreply.github.com> Date: Wed, 20 May 2026 21:11:53 +0800 Subject: [PATCH] docs: add opencode.nvim integration notes --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 21eeaa3bb185..6bf664621739 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,34 @@ With this enabled, yank operations sync to the system clipboard and `p` / `P` pa > [!NOTE] > Terminal/OS clipboard shortcuts don’t preserve Vim linewise register state. External clipboard text is pasted as characterwise text. +## Neovim integration + +Compatible with [`opencode.nvim`](https://github.com/nickjvandyke/opencode.nvim). Use the following server config: + +```lua +local ocv_cmd = "bash -c 'exec -a opencode ocv --port'" + +vim.g.opencode_opts = { + server = { + start = function() + require("opencode.terminal").open(ocv_cmd, { + split = "right", + width = math.floor(vim.o.columns * 0.35), + }) + end, + stop = function() + require("opencode.terminal").close() + end, + toggle = function() + require("opencode.terminal").toggle(ocv_cmd, { + split = "right", + width = math.floor(vim.o.columns * 0.35), + }) + end, + }, +} +``` + ## Feedback Have a suggestion? [Open an issue](https://github.com/leohenon/opencode-vim/issues).