English | 中文
A Neovim plugin that opens a terminal with Coding Agent CLI tools (crush, opencode, claude, gemini-cli, etc.) in a vertical split.
Using lazy.nvim:
{
'gitsang/codock.nvim',
opts = {
width = 80, -- Width of the vertical split
codock_cmd = "opencode", -- Command to run in the terminal (crush, opencode, claude, gemini-cli, etc.)
copy_to_clipboard = false, -- Copy to system clipboard
actions = {},
},
cmd = { "Codock", "CodockFilePosPaste", "CodockFilePosYank", "CodockActions" },
keys = {
{ "<leader>CCO", "<cmd>Codock opencode<cr>", desc = "Toggle Codock Opencode", mode = { "n", "v" } },
{ "<leader>CCC", "<cmd>Codock claude<cr>", desc = "Toggle Codock Claude", mode = { "n", "v" } },
{ "<leader>CCX", "<cmd>Codock omx --madmax --xhigh<cr>", desc = "Toggle Codock Codex", mode = { "n", "v" } },
{ "<leader>CY", ":'<,'>CodockFilePosYank<cr>", desc = "Copy file position", mode = { "n", "v" } },
{ "<leader>CP", ":'<,'>CodockFilePosPaste<cr>", desc = "Copy and paste file position", mode = { "n", "v" } },
{ "<leader>CA", ":'<,'>CodockActions<cr>", desc = "Run Codock actions", mode = { "n", "v" } },
},
}After installation, you can run the following commands:
Run the :Codock command to open a terminal in a vertical split running the configured AI CLI command.
You can also specify a different CLI tool as an argument:
:Codock- Open the default CLI tool configured incodock_cmd:Codock claude- Open claude:Codock opencode- Open opencode:Codock gemini-cli- Open gemini-cli
:CodockFilePosPastecopies the relative file path and line/column information to the clipboard in various visual modes, then sends it to the AI CLI tool.:CodockFilePosYankonly copies the relative file path and line/column information.:CodockFilePosremains as a backward-compatible alias for:CodockFilePosPaste.
The :CodockActions command allows you to define custom actions that can be executed from a popup selector.
You can find how to define your own actions in Custom Actions Tutorial
This plugin supports various AI CLI tools:
crush- Crush CLIopencode- OpenCodeclaude- Claude Codegemini-cli- Gemini CLI
Simply set the codock_cmd option to your preferred AI CLI tool.
