vim_jump
Easily navigate Neovim's jump list: move back, forward, or view all jumps using precise commands for efficient code editing and navigation.
Instructions
Navigate Neovim jump list: go back, forward, or list jumps
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| direction | Yes | Jump direction or list jumps |
Implementation Reference
- src/index.ts:567-591 (registration)Registration of the 'vim_jump' MCP tool, including schema and handler function that delegates to NeovimManagerserver.tool( "vim_jump", "Navigate Neovim jump list: go back, forward, or list jumps", { direction: z.enum(["back", "forward", "list"]).describe("Jump direction or list jumps") }, async ({ direction }) => { try { const result = await neovimManager.navigateJumpList(direction); return { content: [{ type: "text", text: result }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : 'Error navigating jump list' }] }; } } );
- src/index.ts:573-590 (handler)Handler function for vim_jump tool that invokes neovimManager.navigateJumpList and formats the responseasync ({ direction }) => { try { const result = await neovimManager.navigateJumpList(direction); return { content: [{ type: "text", text: result }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : 'Error navigating jump list' }] }; } }
- src/index.ts:570-572 (schema)Input schema for vim_jump tool using Zod validation{ direction: z.enum(["back", "forward", "list"]).describe("Jump direction or list jumps") },
- src/neovim.ts:930-959 (helper)Core implementation of jump list navigation in NeovimManager class, handling back, forward, and list actions via Neovim APIpublic async navigateJumpList(direction: string): Promise<string> { try { const nvim = await this.connect(); switch (direction) { case 'back': await nvim.input('\x0f'); // Ctrl-O return 'Jumped back in jump list'; case 'forward': await nvim.input('\x09'); // Ctrl-I (Tab) return 'Jumped forward in jump list'; case 'list': await nvim.command('jumps'); // Get the output from the command const output = await nvim.eval('execute("jumps")'); return `Jump list:\n${output}`; default: throw new NeovimValidationError(`Unknown jump direction: ${direction}`); } } catch (error) { if (error instanceof NeovimValidationError) { throw error; } console.error('Error navigating jump list:', error); throw new NeovimCommandError(`jump ${direction}`, error instanceof Error ? error.message : 'Unknown error'); } }