Run an Ex command
nvim_commandExecute Neovim Ex commands and receive Neovim's error messages if rejected. Does not wait for the screen to settle.
Instructions
Execute an Ex command. A command that Neovim rejects comes back as an error result with Neovim's own message. Like nvim_input, this does not wait for the screen to settle.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"command": "<command>"
},
"name": "nvim_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Ex command without the leading colon, e.g. "set number", "edit foo.txt", "wq". | |
| sessionId | Yes | Session id returned by nvim_launch or nvim_attach. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| command | Yes | ||
| sessionId | Yes |