Skip to main content
Glama

reload_all_buffers

Reload all open buffers that have changed on disk after external file edits to maintain current content in Neovim.

Instructions

Check all open buffers and reload any that have changed on disk. Use this after editing files externally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that finds Neovim instances, runs 'checktime' command to reload changed buffers, and returns a summary of checked buffers.
    export async function reloadAllBuffers() { const instances = await getNvimInstancesInCwd(); const reloadedBuffers = []; for (const { nvim } of instances) { try { // Use checktime to reload all buffers that have changed on disk await nvim.command("checktime"); const buffers = await nvim.buffers; for (const buf of buffers) { const listed = await nvim.call("buflisted", [buf.id]); if (listed) { const name = await buf.name; if (name) { reloadedBuffers.push(name); } } } } catch (error) { console.error("Error reloading buffers:", error.message); } } return { success: true, message: `Checked ${reloadedBuffers.length} buffer(s) for changes`, buffers: reloadedBuffers, }; }
  • Tool schema definition in the list tools handler, specifying the tool name, description, and empty input schema (no parameters required).
    { name: "reload_all_buffers", description: "Check all open buffers and reload any that have changed on disk. Use this after editing files externally.", inputSchema: { type: "object", properties: {}, }, },
  • index.js:269-279 (registration)
    Registration and dispatch logic in the CallToolRequest handler that invokes the reloadAllBuffers function and formats the response.
    if (name === "reload_all_buffers") { const result = await reloadAllBuffers(); return { content: [ { type: "text", text: result.message, }, ], }; }

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/laktek/nvim-mcp-server'

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