docs: add documentation
This commit is contained in:
@@ -1,6 +1,43 @@
|
||||
# opencode.nvim
|
||||
|
||||
Prototype Neovim plugin that opens `opencode` in a terminal split on the right.
|
||||
Neovim plugin that toggles an `opencode` terminal in a right-side 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Using `vim-plug`:
|
||||
|
||||
```vim
|
||||
Plug 'agj/opencode.nvim'
|
||||
```
|
||||
|
||||
```lua
|
||||
require("opencode").setup()
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -10,18 +47,46 @@ Run:
|
||||
:OpenCodeToggle
|
||||
```
|
||||
|
||||
The command opens `opencode` in a right-side terminal window sized to 40% of the
|
||||
screen width. Running the command again closes only the window; the terminal
|
||||
buffer and `opencode` session stay alive. Run `:OpenCodeToggle` again to show the
|
||||
same session.
|
||||
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.4,
|
||||
width = 0.3,
|
||||
})
|
||||
```
|
||||
|
||||
`width` is the fraction of the screen width used by the terminal window. The
|
||||
default is `0.4`.
|
||||
default is `0.3`. It must be greater than `0` and less than or equal to `1`.
|
||||
|
||||
## 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.
|
||||
|
||||
Reference in New Issue
Block a user