# opencode.nvim Neovim plugin that toggles an `opencode` terminal in a configurable split. The terminal buffer is kept alive when hidden, so your `opencode` session remains available across toggles. ## Requirements - Neovim 0.10 or newer - The `opencode` CLI installed and available on `$PATH` This plugin does not install or bundle `opencode`; it only starts the CLI in a Neovim terminal. Use of `opencode` is subject to that project's own license and terms. ## Installation Install with your plugin manager of choice. Using `lazy.nvim`: ```lua { "agj/opencode.nvim", opts = { width = 0.3, location = "right", }, } ``` Using `vim-plug`: ```vim Plug 'agj/opencode.nvim' ``` ```lua require("opencode").setup() ``` ## Usage Run: ```vim :OpenCodeToggle ``` The command opens `opencode` in a right-side terminal window sized to 30% of the screen width by default. Running the command again closes only the window; the terminal buffer and `opencode` session stay alive. Run `:OpenCodeToggle` again to show the same session. ## Configuration ```lua require("opencode").setup({ width = 0.3, location = "right", }) ``` `width` is the fraction of the screen width used by the terminal window for `left` and `right` locations, or the screen height for `top` and `bottom` locations. The default is `0.3`. It must be greater than `0` and less than or equal to `1`. `location` controls where the terminal window opens. The default is `"right"`. It must be one of `"left"`, `"right"`, `"top"`, or `"bottom"`. ## Help After installing the plugin, run: ```vim :help opencode.nvim ``` If your plugin manager does not generate helptags automatically, run: ```vim :helptags ALL ``` ## License opencode.nvim is free software released under the GNU General Public License, version 3 only. See [LICENSE](LICENSE) for the full license text. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## Trademark Notice opencode.nvim is an independent Neovim plugin and is not affiliated with, endorsed by, or sponsored by the maintainers of `opencode` or Neovim.