Skip to content

[idea] Macro-recording indicator (@q) in the custom statusline #321

Description

@stanfish06

What

The custom statusline (lua/config/statusline.lua) already surfaces a fair amount of live editor state — mode, git branch, LSP clients, an LSP-progress spinner, diagnostics, cursor position — but gives no indication when a macro is currently being recorded. vim.fn.reg_recording() returns the register name (e.g. "q") while recording, or an empty string otherwise.

Where

lua/config/statusline.lua — a small new segment function (following the existing pattern of current_git_branch()/current_lsp_clients()) added to the StatusLine() composition at the bottom of the file (line ~355-365).

Why it matters

Recording a macro with no visual feedback is an easy way to accidentally record over a register or leave a recording running longer than intended — a small, cheap addition here fits the file's existing style of surfacing exactly this kind of otherwise-invisible editor state (the LSP spinner solves the same category of problem for long-running LSP requests).

Recommended action

Add a current_macro_recording() function that checks vim.fn.reg_recording() and, when non-empty, renders something like %#DiagnosticWarn#@q%* (reusing an existing highlight group, consistent with the rest of the file). Recompute on RecordingEnter/RecordingLeave autocmds (or just let it evaluate on every statusline redraw, same as the other segments) and append it into StatusLine().

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions