Skip to content

winbar_when_inactive

Zeioth edited this page Mar 12, 2024 · 2 revisions

You can add this component to the winbar section of heirline opts.

require("heirline-components.all").component.winbar_when_inactive(),

If you use this component before the definition of your winbar components, then the winbar will turn empty when the window loses focus. Like when you are in the terminal, neotree, aerial, etc. screenshot_2024-03-12_21-07-30_816281333

Important note

You must pass this component to heirline in the right order. For example:

winbar = {
  init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end,
  fallthrough = false,
  lib.component.winbar_when_inactive(), -- optional
  {
    -- your other winbar components
    lib.component.breadcrumbs(), -- for example
  }
},
Clone this wiki locally