Skip to content

[idea] Quickfix item count badge in statusline #126

Description

@stanfish06

What

Add a small quickfix/loclist count indicator to StatusLine() that shows how many items are in the active list — e.g. ⚡ 7 — and goes blank when the list is empty.

Where

lua/config/statusline.lua — StatusLine() function and its component helpers (lines 332–342).

Why it matters

The config makes heavy use of the quickfix workflow: makeprg="" + :Compile <cmd> auto-opens copen on error. :vimgrep also populates quickfix. Once those windows are closed, there's no visual indication that items remain jumpable via ]q/[q (or <leader>co). A badge in the statusline closes that loop without requiring the user to re-open the window to check.

Suggested implementation sketch

local function current_quickfix_count()
    local qf = vim.fn.getqflist()
    local n = #qf
    if n == 0 then return "" end
    return string.format(" %%#DiagnosticWarn# ⚡ %d %%*", n)
end

Wire it into StatusLine() between the git branch and LSP clients sections. Subscribe to QuickfixCmdPost and BufWinLeave (for cclose) to redrawstatus — or simply let the existing redraw cadence pick it up since the statusline is already re-evaluated on cursor move.

Consider also showing loclist count separately (vim.fn.getloclist(0)) since the user uses <leader>d to populate the loclist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions