Skip to main content
Glama

vim_visual

Define text selections in a buffer by specifying start and end line and column numbers, enabling precise visual mode operations in Neovim workflows.

Instructions

Create visual mode selections in the buffer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endColumnYesThe ending column number for visual selection (0-indexed)
endLineYesThe ending line number for visual selection (1-indexed)
startColumnYesThe starting column number for visual selection (0-indexed)
startLineYesThe starting line number for visual selection (1-indexed)

Implementation Reference

  • Core implementation of vim_visual tool: enters visual mode and selects range by moving cursor from start to end position.
    public async visualSelect(startLine: number, startCol: number, endLine: number, endCol: number): Promise<string> { try { const nvim = await this.connect(); const window = await nvim.window; // Enter visual mode await nvim.command('normal! v'); // Move cursor to start position await (window.cursor = [startLine, startCol]); // Move cursor to end position (selection will be made) await (window.cursor = [endLine, endCol]); return 'Visual selection made'; } catch (error) { console.error('Error making visual selection:', error); return 'Error making visual selection'; } }
  • src/index.ts:270-296 (registration)
    Registers the vim_visual tool with the MCP server, including schema and wrapper handler that delegates to NeovimManager.visualSelect.
    server.tool( "vim_visual", "Create visual mode selections in the buffer", { startLine: z.number().describe("The starting line number for visual selection (1-indexed)"), startColumn: z.number().describe("The starting column number for visual selection (0-indexed)"), endLine: z.number().describe("The ending line number for visual selection (1-indexed)"), endColumn: z.number().describe("The ending column number for visual selection (0-indexed)") }, async ({ startLine, startColumn, endLine, endColumn }) => { try { const result = await neovimManager.visualSelect(startLine, startColumn, endLine, endColumn); return { content: [{ type: "text", text: result }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : 'Error creating visual selection' }] }; } }
  • Zod schema defining input parameters for the vim_visual tool.
    { startLine: z.number().describe("The starting line number for visual selection (1-indexed)"), startColumn: z.number().describe("The starting column number for visual selection (0-indexed)"), endLine: z.number().describe("The ending line number for visual selection (1-indexed)"), endColumn: z.number().describe("The ending column number for visual selection (0-indexed)") },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bigcodegen/mcp-neovim-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server