Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nx.statusline

nx.statusline.segment(spec)

nx.statusline.segment { name = “git”, events = { “BufEnter”, “DirChanged” }, render = function(ctx) return { { text = “ main“, hl = “StatusGit” } } end } Register a custom segment. render(ctx) (ctx = { buf, win, focused }) returns a list of cells { text = "…", hl = "Group"? }, or nil/empty for nothing. events (optional) are standard autocmd event names that invalidate it.

Defined in statusline.lua.

nx.statusline.invalidate(name)

nx.statusline.invalidate(name): mark a custom segment dirty so the server re-renders it (per window) when the current input settles. The async pattern: a job finishes, caches its data, then invalidates its own segment. Deferring to the server (rather than rendering inline) means a re-render always runs against a fresh window mirror — see nx._statusline_invalidate.

Defined in statusline.lua.

nx.statusline.setup(opts)

nx.statusline.setup { left = { “mode”, “filename” }, right = { “diagnostics”, “location” } } Activate a segment layout. While the global layout is active it takes precedence over the 'statusline' %-format for every window without its own override.

opts.win (0 = current) sets a window-local layout that overrides the global one for that window. opts.format = true opts a window back to the 'statusline' %-format even while a global segment layout is active (the per-region mix); for the global target it clears the global layout.

opts.separator is the connector painted before, between, and after the segments of each half (default " ", in the base StatusLine look). Pass "" to disable it — a powerline / themed statusline manages its own padding and section arrows and wants a seamless coloured bar with no unstyled gaps.

Defined in statusline.lua.

nx.statusline.reset(win)

nx.statusline.reset([win]): drop a window-local override (0 = current window) so the window re-inherits the global layout. With no win it clears the global layout, returning every inheriting window to the 'statusline' %-format.

Defined in statusline.lua.