Files
mcp-memory/agent-rules/neovim_ux.md
T

1006 B

Neovim UX Protocol & Live Editing

Whenever you need to actively interact with the user's Neovim UI or dynamically inject code edits into their live buffers, use the nvim_execute_lua tool (the "God Mode" escape hatch).

1. Showing UI Feedback (Agent Notifications)

The user has a global Lua table _G.gemini loaded in their Neovim environment. You can use it to pop up a floating notification window when you are starting a background task.

Lua snippet to execute: lua _G.gemini.show_progress("Analyzing...")

2. Live Undo-able Code Injection

Instead of using replace_file_content to write code directly to the hard drive, you can pipe your code changes directly into the user's active buffer memory. This allows the user to instantly press undo to revert your code.

Workflow Rule: If the user asks you to "refactor this block", use vim.api.nvim_buf_set_lines to inject your response instantly into their live editor. Do NOT write to disk unless they explicitly say "save the file".